176 lines
16 KiB
JSON
176 lines
16 KiB
JSON
{
|
|
"schemaVersion": "2.0.0",
|
|
"contractName": "ITokenSpenderFeature",
|
|
"compilerOutput": {
|
|
"abi": [
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "token",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "owner",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "to",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "amount",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "_spendERC20Tokens",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "getAllowanceTarget",
|
|
"outputs": [
|
|
{
|
|
"internalType": "address",
|
|
"name": "target",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "token",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "owner",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "getSpendableERC20BalanceOf",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "amount",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
}
|
|
],
|
|
"devdoc": {
|
|
"details": "Feature that allows spending token allowances.",
|
|
"kind": "dev",
|
|
"methods": {
|
|
"_spendERC20Tokens(address,address,address,uint256)": {
|
|
"details": "Transfers ERC20 tokens from `owner` to `to`. Only callable from within.",
|
|
"params": {
|
|
"amount": "The amount of `token` to transfer.",
|
|
"owner": "The owner of the tokens.",
|
|
"to": "The recipient of the tokens.",
|
|
"token": "The token to spend."
|
|
}
|
|
},
|
|
"getAllowanceTarget()": {
|
|
"details": "Get the address of the allowance target.",
|
|
"returns": {
|
|
"target": "The target of token allowances."
|
|
}
|
|
},
|
|
"getSpendableERC20BalanceOf(address,address)": {
|
|
"details": "Gets the maximum amount of an ERC20 token `token` that can be pulled from `owner`.",
|
|
"params": {
|
|
"owner": "The owner of the tokens.",
|
|
"token": "The token to spend."
|
|
},
|
|
"returns": {
|
|
"amount": "The amount of tokens that can be pulled."
|
|
}
|
|
}
|
|
},
|
|
"version": 1
|
|
},
|
|
"evm": {
|
|
"bytecode": {
|
|
"linkReferences": {},
|
|
"object": "0x",
|
|
"opcodes": "",
|
|
"sourceMap": ""
|
|
},
|
|
"deployedBytecode": {
|
|
"immutableReferences": {},
|
|
"linkReferences": {},
|
|
"object": "0x",
|
|
"opcodes": "",
|
|
"sourceMap": ""
|
|
},
|
|
"methodIdentifiers": {
|
|
"_spendERC20Tokens(address,address,address,uint256)": "89dd02e7",
|
|
"getAllowanceTarget()": "f7c3a33b",
|
|
"getSpendableERC20BalanceOf(address,address)": "496f471e"
|
|
}
|
|
}
|
|
},
|
|
"sourceTreeHashHex": "0xf5a9c6e9e060fe08c800cf73043470890c8cb836c9a10ea5450f2af51b6d4544",
|
|
"sources": {
|
|
"./ITokenSpenderFeature.sol": {
|
|
"id": 0,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\n\n\n/// @dev Feature that allows spending token allowances.\ninterface ITokenSpenderFeature {\n\n /// @dev Transfers ERC20 tokens from `owner` to `to`.\n /// Only callable from within.\n /// @param token The token to spend.\n /// @param owner The owner of the tokens.\n /// @param to The recipient of the tokens.\n /// @param amount The amount of `token` to transfer.\n function _spendERC20Tokens(\n IERC20TokenV06 token,\n address owner,\n address to,\n uint256 amount\n )\n external;\n\n /// @dev Gets the maximum amount of an ERC20 token `token` that can be\n /// pulled from `owner`.\n /// @param token The token to spend.\n /// @param owner The owner of the tokens.\n /// @return amount The amount of tokens that can be pulled.\n function getSpendableERC20BalanceOf(IERC20TokenV06 token, address owner)\n external\n view\n returns (uint256 amount);\n\n /// @dev Get the address of the allowance target.\n /// @return target The target of token allowances.\n function getAllowanceTarget() external view returns (address target);\n}\n"
|
|
},
|
|
"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol": {
|
|
"id": 1,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\ninterface IERC20TokenV06 {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed from,\n address indexed to,\n uint256 value\n );\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address to, uint256 value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param from The address of the sender\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address from,\n address to,\n uint256 value\n )\n external\n returns (bool);\n\n /// @dev `msg.sender` approves `spender` to spend `value` tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @param value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address spender, uint256 value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n\n /// @dev Get the balance of `owner`.\n /// @param owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address owner)\n external\n view\n returns (uint256);\n\n /// @dev Get the allowance for `spender` to spend from `owner`.\n /// @param owner The address of the account owning tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n /// @dev Get the number of decimals this token has.\n function decimals()\n external\n view\n returns (uint8);\n}\n"
|
|
}
|
|
},
|
|
"sourceCodes": {
|
|
"./ITokenSpenderFeature.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\n\n\n/// @dev Feature that allows spending token allowances.\ninterface ITokenSpenderFeature {\n\n /// @dev Transfers ERC20 tokens from `owner` to `to`.\n /// Only callable from within.\n /// @param token The token to spend.\n /// @param owner The owner of the tokens.\n /// @param to The recipient of the tokens.\n /// @param amount The amount of `token` to transfer.\n function _spendERC20Tokens(\n IERC20TokenV06 token,\n address owner,\n address to,\n uint256 amount\n )\n external;\n\n /// @dev Gets the maximum amount of an ERC20 token `token` that can be\n /// pulled from `owner`.\n /// @param token The token to spend.\n /// @param owner The owner of the tokens.\n /// @return amount The amount of tokens that can be pulled.\n function getSpendableERC20BalanceOf(IERC20TokenV06 token, address owner)\n external\n view\n returns (uint256 amount);\n\n /// @dev Get the address of the allowance target.\n /// @return target The target of token allowances.\n function getAllowanceTarget() external view returns (address target);\n}\n",
|
|
"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\ninterface IERC20TokenV06 {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed from,\n address indexed to,\n uint256 value\n );\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address to, uint256 value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param from The address of the sender\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address from,\n address to,\n uint256 value\n )\n external\n returns (bool);\n\n /// @dev `msg.sender` approves `spender` to spend `value` tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @param value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address spender, uint256 value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n\n /// @dev Get the balance of `owner`.\n /// @param owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address owner)\n external\n view\n returns (uint256);\n\n /// @dev Get the allowance for `spender` to spend from `owner`.\n /// @param owner The address of the account owning tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n /// @dev Get the number of decimals this token has.\n function decimals()\n external\n view\n returns (uint8);\n}\n"
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.6.12+commit.27d51765",
|
|
"settings": {
|
|
"remappings": [
|
|
"@0x/contracts-utils=/Users/michaelzhu/protocol/node_modules/@0x/contracts-utils",
|
|
"@0x/contracts-erc20=/Users/michaelzhu/protocol/contracts/zero-ex/node_modules/@0x/contracts-erc20"
|
|
],
|
|
"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",
|
|
"evm.methodIdentifiers"
|
|
]
|
|
}
|
|
},
|
|
"evmVersion": "istanbul"
|
|
}
|
|
},
|
|
"chains": {}
|
|
}
|