@andrekorol/kollateral-contracts
Version:
Kollateral protocol, the flash loan building block
1,104 lines • 92.2 kB
JSON
{
"contractName": "UnlimitedApprovalErc20",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is called. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/token/UnlimitedApprovalErc20.sol\":\"UnlimitedApprovalErc20\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/token/UnlimitedApprovalErc20.sol\":{\"keccak256\":\"0x407178fcd78f0a19d705e64aaaa26ae997d228f077f3cf6833f9f3eb31c72308\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://097906cbe6f8f35ba1763bd122d551ec302f45cf677021bbcdb8a55c706940d9\",\"dweb:/ipfs/QmVh7kcUWsXt3QApppB1njhGHfzdP813KSTUF6bh3VCmMM\"]},\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0x910a2e625b71168563edf9eeef55a50d6d699acfe27ceba3921f291829a8f938\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://248246ac66e6479dce1ad7d4945ec5540c98ceb09881e93c93f7c48d5772925c\",\"dweb:/ipfs/QmXr8tmUiZgEYid6ixeeBRmTdUnASWjKzhP3KRxMPy8fRt\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0xba96bc371ba999f452985a98717cca1e4c4abb598dc038a9a9c3db08129b1ba4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://26e50e3f7b6482fb6f598f2e006994a74aa492687daa4b3eee7fd4fb5398ce7f\",\"dweb:/ipfs/QmZudqoPSkA4USLMFsBBmt19dDPZFS8aaAmL5R7pECXu6t\"]},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0x482b6d82ba1c9c73758ae15068a438361d4187b7a4e342db17ef0f828cb5e21a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://89725e56bc9c6cfb69521ceaa4a489561b928e930b71e30db85b24024c1c2c03\",\"dweb:/ipfs/QmNvpotZA1Fe48msV6TShSTVxeQ2dkaDS9MTKP4bNxyUG3\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xbd74f587ab9b9711801baf667db1426e4a03fd2d7f15af33e0e0d0394e7cef76\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2d0913dfbfce90d170df0d496ad7596c0778518e5fa7aba6c32562522546f66b\",\"dweb:/ipfs/QmR6B8nLj2PJf5e1JWD9Nk7ErkAwkqUwadCnvE82FJr1RU\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "/*\n\n Copyright 2020 Kollateral LLC.\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\n// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.7.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\nabstract contract UnlimitedApprovalErc20 is ERC20 {\n using SafeMath for uint256;\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n if (allowance(sender, _msgSender()) != uint256(-1)) {\n _approve(\n sender,\n _msgSender(),\n allowance(sender, _msgSender()).sub(\n amount,\n \"UnlimitedApprovalErc20: transfer amount exceeds allowance\"\n )\n );\n }\n return true;\n }\n}\n",
"sourcePath": "/Users/andrekorol/src/kollateral/protocol/contracts/token/UnlimitedApprovalErc20.sol",
"ast": {
"absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/token/UnlimitedApprovalErc20.sol",
"exportedSymbols": {
"Context": [
5279
],
"ERC20": [
6087
],
"IERC20": [
6165
],
"SafeMath": [
5584
],
"UnlimitedApprovalErc20": [
5256
]
},
"id": 5257,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5199,
"literals": [
"solidity",
"^",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "640:23:37"
},
{
"absolutePath": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
"file": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
"id": 5200,
"nodeType": "ImportDirective",
"scope": 5257,
"sourceUnit": 6088,
"src": "665:55:37",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@openzeppelin/contracts/math/SafeMath.sol",
"file": "@openzeppelin/contracts/math/SafeMath.sol",
"id": 5201,
"nodeType": "ImportDirective",
"scope": 5257,
"sourceUnit": 5585,
"src": "721:51:37",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 5202,
"name": "ERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6087,
"src": "818:5:37",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20_$6087",
"typeString": "contract ERC20"
}
},
"id": 5203,
"nodeType": "InheritanceSpecifier",
"src": "818:5:37"
}
],
"contractDependencies": [
5279,
6087,
6165
],
"contractKind": "contract",
"fullyImplemented": false,
"id": 5256,
"linearizedBaseContracts": [
5256,
6087,
6165,
5279
],
"name": "UnlimitedApprovalErc20",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 5206,
"libraryName": {
"id": 5204,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5584,
"src": "836:8:37",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$5584",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "830:27:37",
"typeName": {
"id": 5205,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "849:7:37",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"baseFunctions": [
5785
],
"body": {
"id": 5254,
"nodeType": "Block",
"src": "1005:416:37",
"statements": [
{
"expression": {
"arguments": [
{
"id": 5219,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5208,
"src": "1025:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 5220,
"name": "recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5210,
"src": "1033:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 5221,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5212,
"src": "1044:6:37",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 5218,
"name": "_transfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5908,
"src": "1015:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 5222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1015:36:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5223,
"nodeType": "ExpressionStatement",
"src": "1015:36:37"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 5225,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5208,
"src": "1075:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 5226,
"name": "_msgSender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5267,
"src": "1083:10:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_payable_$",
"typeString": "function () view returns (address payable)"
}
},
"id": 5227,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1083:12:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 5224,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5726,
"src": "1065:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (address,address) view returns (uint256)"
}
},
"id": 5228,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1065:31:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"arguments": [
{
"id": 5232,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "1108:2:37",
"subExpression": {
"hexValue": "31",
"id": 5231,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1109:1:37",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
],
"id": 5230,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1100:7:37",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 5229,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1100:7:37",
"typeDescriptions": {}
}
},
"id": 5233,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1100:11:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1065:46:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 5251,
"nodeType": "IfStatement",
"src": "1061:333:37",
"trueBody": {
"id": 5250,
"nodeType": "Block",
"src": "1113:281:37",
"statements": [
{
"expression": {
"arguments": [
{
"id": 5236,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5208,
"src": "1153:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 5237,
"name": "_msgSender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5267,
"src": "1177:10:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_payable_$",
"typeString": "function () view returns (address payable)"
}
},
"id": 5238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1177:12:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"arguments": [
{
"id": 5245,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5212,
"src": "1264:6:37",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"hexValue": "556e6c696d69746564417070726f76616c45726332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365",
"id": 5246,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1292:59:37",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_725013a490abf2b9cd6a7f8f22541d815b2033a8364e6b21879f646215ab11ef",
"typeString": "literal_string \"UnlimitedApprovalErc20: transfer amount exceeds allowance\""
},
"value": "UnlimitedApprovalErc20: transfer amount exceeds allowance"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_stringliteral_725013a490abf2b9cd6a7f8f22541d815b2033a8364e6b21879f646215ab11ef",
"typeString": "literal_string \"UnlimitedApprovalErc20: transfer amount exceeds allowance\""
}
],
"expression": {
"arguments": [
{
"id": 5240,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5208,
"src": "1217:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 5241,
"name": "_msgSender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5267,
"src": "1225:10:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_payable_$",
"typeString": "function () view returns (address payable)"
}
},
"id": 5242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1225:12:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 5239,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5726,
"src": "1207:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (address,address) view returns (uint256)"
}
},
"id": 5243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1207:31:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 5244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 5462,
"src": "1207:35:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256,string memory) pure returns (uint256)"
}
},
"id": 5247,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1207:162:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 5235,
"name": "_approve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6064,
"src": "1127:8:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 5248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1127:256:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5249,
"nodeType": "ExpressionStatement",
"src": "1127:256:37"
}
]
}
},
{
"expression": {
"hexValue": "74727565",
"id": 5252,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1410:4:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 5217,
"id": 5253,
"nodeType": "Return",
"src": "1403:11:37"
}
]
},
"functionSelector": "23b872dd",
"id": 5255,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "transferFrom",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 5214,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "981:8:37"
},
"parameters": {
"id": 5213,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5208,
"mutability": "mutable",
"name": "sender",
"nodeType": "VariableDeclaration",
"scope": 5255,
"src": "894:14:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5207,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "894:7:37",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5210,
"mutability": "mutable",
"name": "recipient",
"nodeType": "VariableDeclaration",
"scope": 5255,
"src": "918:17:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5209,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "918:7:37",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5212,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 5255,
"src": "945:14:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5211,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "945:7:37",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "884:81:37"
},
"returnParameters": {
"id": 5217,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5216,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5255,
"src": "999:4:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 5215,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "999:4:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "998:6:37"
},
"scope": 5256,
"src": "863:558:37",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
}
],
"scope": 5257,
"src": "774:649:37"
}
],
"src": "640:784:37"
},
"legacyAST": {
"attributes": {
"absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/token/UnlimitedApprovalErc20.sol",
"exportedSymbols": {
"Context": [
52