@0x/contract-artifacts: Add ITransformERC20 artifact.

`@0x/contract-wrappers`: Add `ITransformERC20Contract`.
This commit is contained in:
Lawrence Forman
2020-06-01 15:13:05 -04:00
parent 2a81e468c7
commit 3e3bc5c06d
8 changed files with 996 additions and 2 deletions

View File

@@ -29,6 +29,10 @@
{
"note": "Added `ERC20BridgeSampler.sampleSellsFromMultiBridge",
"pr": 2593
},
{
"note": "Added `ITransformERC20`",
"pr": 2591
}
]
},

View File

@@ -0,0 +1,152 @@
{
"schemaVersion": "2.0.0",
"contractName": "ITransformERC20",
"compilerOutput": {
"abi": [
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "taker", "type": "address" },
{ "indexed": false, "internalType": "address", "name": "inputToken", "type": "address" },
{ "indexed": false, "internalType": "address", "name": "outputToken", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "inputTokenAmount", "type": "uint256" },
{ "indexed": false, "internalType": "uint256", "name": "outputTokenAmount", "type": "uint256" }
],
"name": "TransformedERC20",
"type": "event"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "callDataHash", "type": "bytes32" },
{ "internalType": "address payable", "name": "taker", "type": "address" },
{ "internalType": "contract IERC20TokenV06", "name": "inputToken", "type": "address" },
{ "internalType": "contract IERC20TokenV06", "name": "outputToken", "type": "address" },
{ "internalType": "uint256", "name": "inputTokenAmount", "type": "uint256" },
{ "internalType": "uint256", "name": "minOutputTokenAmount", "type": "uint256" },
{
"components": [
{ "internalType": "contract IERC20Transformer", "name": "transformer", "type": "address" },
{ "internalType": "bytes", "name": "data", "type": "bytes" }
],
"internalType": "struct ITransformERC20.Transformation[]",
"name": "transformations",
"type": "tuple[]"
}
],
"name": "_transformERC20",
"outputs": [{ "internalType": "uint256", "name": "outputTokenAmount", "type": "uint256" }],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "createTransformWallet",
"outputs": [{ "internalType": "contract IFlashWallet", "name": "wallet", "type": "address" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getTransformWallet",
"outputs": [{ "internalType": "contract IFlashWallet", "name": "wallet", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTransformerDeployer",
"outputs": [{ "internalType": "address", "name": "deployer", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "contract IERC20TokenV06", "name": "inputToken", "type": "address" },
{ "internalType": "contract IERC20TokenV06", "name": "outputToken", "type": "address" },
{ "internalType": "uint256", "name": "inputTokenAmount", "type": "uint256" },
{ "internalType": "uint256", "name": "minOutputTokenAmount", "type": "uint256" },
{
"components": [
{ "internalType": "contract IERC20Transformer", "name": "transformer", "type": "address" },
{ "internalType": "bytes", "name": "data", "type": "bytes" }
],
"internalType": "struct ITransformERC20.Transformation[]",
"name": "transformations",
"type": "tuple[]"
}
],
"name": "transformERC20",
"outputs": [{ "internalType": "uint256", "name": "outputTokenAmount", "type": "uint256" }],
"stateMutability": "payable",
"type": "function"
}
],
"devdoc": {
"details": "Feature to composably transform between ERC20 tokens.",
"methods": {
"_transformERC20(bytes32,address,address,address,uint256,uint256,(address,bytes)[])": {
"details": "Internal version of `transformERC20()`. Only callable from within.",
"params": {
"callDataHash": "Hash of the ingress calldata.",
"inputToken": "The token being provided by the taker. If `0xeee...`, ETH is implied and should be provided with the call.`",
"inputTokenAmount": "The amount of `inputToken` to take from the taker.",
"minOutputTokenAmount": "The minimum amount of `outputToken` the taker must receive for the entire transformation to succeed.",
"outputToken": "The token to be acquired by the taker. `0xeee...` implies ETH.",
"taker": "The taker address.",
"transformations": "The transformations to execute on the token balance(s) in sequence."
},
"returns": { "outputTokenAmount": "The amount of `outputToken` received by the taker." }
},
"createTransformWallet()": {
"details": "Deploy a new flash wallet instance and replace the current one with it. Useful if we somehow break the current wallet instance. Anyone can call this.",
"returns": { "wallet": "The new wallet instance." }
},
"getTransformWallet()": {
"details": "Return the current wallet instance that will serve as the execution context for transformations.",
"returns": { "wallet": "The wallet instance." }
},
"getTransformerDeployer()": {
"details": "Return the allowed deployer for transformers.",
"returns": { "deployer": "The transform deployer address." }
},
"transformERC20(address,address,uint256,uint256,(address,bytes)[])": {
"details": "Executes a series of transformations to convert an ERC20 `inputToken` to an ERC20 `outputToken`.",
"params": {
"inputToken": "The token being provided by the sender. If `0xeee...`, ETH is implied and should be provided with the call.`",
"inputTokenAmount": "The amount of `inputToken` to take from the sender.",
"minOutputTokenAmount": "The minimum amount of `outputToken` the sender must receive for the entire transformation to succeed.",
"outputToken": "The token to be acquired by the sender. `0xeee...` implies ETH.",
"transformations": "The transformations to execute on the token balance(s) in sequence."
},
"returns": { "outputTokenAmount": "The amount of `outputToken` received by the sender." }
}
}
},
"evm": { "bytecode": { "object": "0x" }, "deployedBytecode": { "immutableReferences": {}, "object": "0x" } }
},
"compiler": {
"name": "solc",
"version": "0.6.8+commit.0bbfe453",
"settings": {
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
"abi",
"devdoc",
"evm.bytecode.object",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.object",
"evm.deployedBytecode.sourceMap"
]
}
},
"evmVersion": "istanbul"
}
},
"chains": {}
}

View File

@@ -26,6 +26,7 @@ import * as ZRXToken from '../artifacts/ZRXToken.json';
import * as ERC20BridgeProxy from '../artifacts/ERC20BridgeProxy.json';
import * as ZrxVault from '../artifacts/ZrxVault.json';
import * as IERC20BridgeSampler from '../artifacts/IERC20BridgeSampler.json';
import * as ITransformERC20 from '../artifacts/ITransformERC20.json';
export {
AssetProxyOwner,
@@ -56,4 +57,5 @@ export {
StakingProxy,
ZrxVault,
IERC20BridgeSampler,
ITransformERC20,
};

View File

@@ -36,6 +36,7 @@
"./artifacts/StakingProxy.json",
"./artifacts/ZrxVault.json",
"./artifacts/ERC20BridgeProxy.json",
"./artifacts/IERC20BridgeSampler.json"
"./artifacts/IERC20BridgeSampler.json",
"./artifacts/ITransformERC20.json"
]
}