Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Contract Name:
Donator
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity)
/** *Submitted for verification at PolygonScan.com on 2021-10-12 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts/Donator.sol pragma solidity ^0.8.0; contract Donator { IERC20 private $token; constructor(IERC20 _token){ $token = _token; } function token() external view returns (IERC20) { return $token; } event Donation(address indexed sender, address indexed receiver, string uri, uint amount); function donate(address payable _receiver, string memory _uri, uint _amount) external { require(_amount > 0, "Donator: invalid amount"); require($token.transferFrom(msg.sender, _receiver, _amount)); emit Donation(msg.sender, _receiver, _uri, _amount); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"string","name":"uri","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Donation","type":"event"},{"inputs":[{"internalType":"address payable","name":"_receiver","type":"address"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"donate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516108323803806108328339818101604052810190610032919061008d565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061011a565b60008151905061008781610103565b92915050565b6000602082840312156100a3576100a26100fe565b5b60006100b184828501610078565b91505092915050565b60006100c5826100de565b9050919050565b60006100d7826100ba565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b61010c816100cc565b811461011757600080fd5b50565b610709806101296000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063ad1829871461003b578063fc0c546a14610057575b600080fd5b610055600480360381019061005091906102b4565b610075565b005b61005f6101dc565b60405161006c919061041f565b60405180910390f35b600081116100b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100af9061046a565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3385846040518463ffffffff1660e01b8152600401610115939291906103e8565b602060405180830381600087803b15801561012f57600080fd5b505af1158015610143573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101679190610323565b61017057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffe69522520feec40fff058da0d81cc80babaff3cc97236c75e72b7a119a6bd2084846040516101cf92919061043a565b60405180910390a3505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610218610213846104af565b61048a565b90508281526020810184848401111561023457610233610645565b5b61023f84828561059e565b509392505050565b6000813590506102568161068e565b92915050565b60008151905061026b816106a5565b92915050565b600082601f83011261028657610285610640565b5b8135610296848260208601610205565b91505092915050565b6000813590506102ae816106bc565b92915050565b6000806000606084860312156102cd576102cc61064f565b5b60006102db86828701610247565b935050602084013567ffffffffffffffff8111156102fc576102fb61064a565b5b61030886828701610271565b92505060406103198682870161029f565b9150509250925092565b6000602082840312156103395761033861064f565b5b60006103478482850161025c565b91505092915050565b61035981610556565b82525050565b610368816104fc565b82525050565b61037781610568565b82525050565b6000610388826104e0565b61039281856104eb565b93506103a28185602086016105ad565b6103ab81610654565b840191505092915050565b60006103c36017836104eb565b91506103ce82610665565b602082019050919050565b6103e28161054c565b82525050565b60006060820190506103fd600083018661035f565b61040a6020830185610350565b61041760408301846103d9565b949350505050565b6000602082019050610434600083018461036e565b92915050565b60006040820190508181036000830152610454818561037d565b905061046360208301846103d9565b9392505050565b60006020820190508181036000830152610483816103b6565b9050919050565b60006104946104a5565b90506104a082826105e0565b919050565b6000604051905090565b600067ffffffffffffffff8211156104ca576104c9610611565b5b6104d382610654565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b60006105078261052c565b9050919050565b60006105198261052c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006105618261057a565b9050919050565b60006105738261057a565b9050919050565b60006105858261058c565b9050919050565b60006105978261052c565b9050919050565b82818337600083830152505050565b60005b838110156105cb5780820151818401526020810190506105b0565b838111156105da576000848401525b50505050565b6105e982610654565b810181811067ffffffffffffffff8211171561060857610607610611565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f446f6e61746f723a20696e76616c696420616d6f756e74000000000000000000600082015250565b6106978161050e565b81146106a257600080fd5b50565b6106ae81610520565b81146106b957600080fd5b50565b6106c58161054c565b81146106d057600080fd5b5056fea2646970667358221220222779659e525d0848993c536e94a9f17c6a2ac33bdf42ff2e958b43847a65d164736f6c63430008070033000000000000000000000000e93c4431494b45115ea656274ea75b987f541b17
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e93c4431494b45115ea656274ea75b987f541b17
-----Decoded View---------------
Arg [0] : _token (address): 0xe93c4431494b45115ea656274ea75b987f541b17
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e93c4431494b45115ea656274ea75b987f541b17
Deployed ByteCode Sourcemap
2894:612:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3218:285;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;3024:80;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3218:285;3333:1;3323:7;:11;3315:47;;;;;;;;;;;;:::i;:::-;;;;;;;;;3381:6;;;;;;;;;;:19;;;3401:10;3413:9;3424:7;3381:51;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3373:60;;;;;;3470:9;3449:46;;3458:10;3449:46;;;3481:4;3487:7;3449:46;;;;;;;:::i;:::-;;;;;;;;3218:285;;;:::o;3024:80::-;3064:6;3090;;;;;;;;;;;3083:13;;3024:80;:::o;7:412:1:-;85:5;110:66;126:49;168:6;126:49;:::i;:::-;110:66;:::i;:::-;101:75;;199:6;192:5;185:21;237:4;230:5;226:16;275:3;266:6;261:3;257:16;254:25;251:112;;;282:79;;:::i;:::-;251:112;372:41;406:6;401:3;396;372:41;:::i;:::-;91:328;7:412;;;;;:::o;425:155::-;479:5;517:6;504:20;495:29;;533:41;568:5;533:41;:::i;:::-;425:155;;;;:::o;586:137::-;640:5;671:6;665:13;656:22;;687:30;711:5;687:30;:::i;:::-;586:137;;;;:::o;743:340::-;799:5;848:3;841:4;833:6;829:17;825:27;815:122;;856:79;;:::i;:::-;815:122;973:6;960:20;998:79;1073:3;1065:6;1058:4;1050:6;1046:17;998:79;:::i;:::-;989:88;;805:278;743:340;;;;:::o;1089:139::-;1135:5;1173:6;1160:20;1151:29;;1189:33;1216:5;1189:33;:::i;:::-;1089:139;;;;:::o;1234:815::-;1329:6;1337;1345;1394:2;1382:9;1373:7;1369:23;1365:32;1362:119;;;1400:79;;:::i;:::-;1362:119;1520:1;1545:61;1598:7;1589:6;1578:9;1574:22;1545:61;:::i;:::-;1535:71;;1491:125;1683:2;1672:9;1668:18;1655:32;1714:18;1706:6;1703:30;1700:117;;;1736:79;;:::i;:::-;1700:117;1841:63;1896:7;1887:6;1876:9;1872:22;1841:63;:::i;:::-;1831:73;;1626:288;1953:2;1979:53;2024:7;2015:6;2004:9;2000:22;1979:53;:::i;:::-;1969:63;;1924:118;1234:815;;;;;:::o;2055:345::-;2122:6;2171:2;2159:9;2150:7;2146:23;2142:32;2139:119;;;2177:79;;:::i;:::-;2139:119;2297:1;2322:61;2375:7;2366:6;2355:9;2351:22;2322:61;:::i;:::-;2312:71;;2268:125;2055:345;;;;:::o;2406:147::-;2501:45;2540:5;2501:45;:::i;:::-;2496:3;2489:58;2406:147;;:::o;2559:118::-;2646:24;2664:5;2646:24;:::i;:::-;2641:3;2634:37;2559:118;;:::o;2683:157::-;2783:50;2827:5;2783:50;:::i;:::-;2778:3;2771:63;2683:157;;:::o;2846:364::-;2934:3;2962:39;2995:5;2962:39;:::i;:::-;3017:71;3081:6;3076:3;3017:71;:::i;:::-;3010:78;;3097:52;3142:6;3137:3;3130:4;3123:5;3119:16;3097:52;:::i;:::-;3174:29;3196:6;3174:29;:::i;:::-;3169:3;3165:39;3158:46;;2938:272;2846:364;;;;:::o;3216:366::-;3358:3;3379:67;3443:2;3438:3;3379:67;:::i;:::-;3372:74;;3455:93;3544:3;3455:93;:::i;:::-;3573:2;3568:3;3564:12;3557:19;;3216:366;;;:::o;3588:118::-;3675:24;3693:5;3675:24;:::i;:::-;3670:3;3663:37;3588:118;;:::o;3712:458::-;3869:4;3907:2;3896:9;3892:18;3884:26;;3920:71;3988:1;3977:9;3973:17;3964:6;3920:71;:::i;:::-;4001:80;4077:2;4066:9;4062:18;4053:6;4001:80;:::i;:::-;4091:72;4159:2;4148:9;4144:18;4135:6;4091:72;:::i;:::-;3712:458;;;;;;:::o;4176:248::-;4282:4;4320:2;4309:9;4305:18;4297:26;;4333:84;4414:1;4403:9;4399:17;4390:6;4333:84;:::i;:::-;4176:248;;;;:::o;4430:423::-;4571:4;4609:2;4598:9;4594:18;4586:26;;4658:9;4652:4;4648:20;4644:1;4633:9;4629:17;4622:47;4686:78;4759:4;4750:6;4686:78;:::i;:::-;4678:86;;4774:72;4842:2;4831:9;4827:18;4818:6;4774:72;:::i;:::-;4430:423;;;;;:::o;4859:419::-;5025:4;5063:2;5052:9;5048:18;5040:26;;5112:9;5106:4;5102:20;5098:1;5087:9;5083:17;5076:47;5140:131;5266:4;5140:131;:::i;:::-;5132:139;;4859:419;;;:::o;5284:129::-;5318:6;5345:20;;:::i;:::-;5335:30;;5374:33;5402:4;5394:6;5374:33;:::i;:::-;5284:129;;;:::o;5419:75::-;5452:6;5485:2;5479:9;5469:19;;5419:75;:::o;5500:308::-;5562:4;5652:18;5644:6;5641:30;5638:56;;;5674:18;;:::i;:::-;5638:56;5712:29;5734:6;5712:29;:::i;:::-;5704:37;;5796:4;5790;5786:15;5778:23;;5500:308;;;:::o;5814:99::-;5866:6;5900:5;5894:12;5884:22;;5814:99;;;:::o;5919:169::-;6003:11;6037:6;6032:3;6025:19;6077:4;6072:3;6068:14;6053:29;;5919:169;;;;:::o;6094:96::-;6131:7;6160:24;6178:5;6160:24;:::i;:::-;6149:35;;6094:96;;;:::o;6196:104::-;6241:7;6270:24;6288:5;6270:24;:::i;:::-;6259:35;;6196:104;;;:::o;6306:90::-;6340:7;6383:5;6376:13;6369:21;6358:32;;6306:90;;;:::o;6402:126::-;6439:7;6479:42;6472:5;6468:54;6457:65;;6402:126;;;:::o;6534:77::-;6571:7;6600:5;6589:16;;6534:77;;;:::o;6617:134::-;6675:9;6708:37;6739:5;6708:37;:::i;:::-;6695:50;;6617:134;;;:::o;6757:139::-;6820:9;6853:37;6884:5;6853:37;:::i;:::-;6840:50;;6757:139;;;:::o;6902:126::-;6952:9;6985:37;7016:5;6985:37;:::i;:::-;6972:50;;6902:126;;;:::o;7034:113::-;7084:9;7117:24;7135:5;7117:24;:::i;:::-;7104:37;;7034:113;;;:::o;7153:154::-;7237:6;7232:3;7227;7214:30;7299:1;7290:6;7285:3;7281:16;7274:27;7153:154;;;:::o;7313:307::-;7381:1;7391:113;7405:6;7402:1;7399:13;7391:113;;;7490:1;7485:3;7481:11;7475:18;7471:1;7466:3;7462:11;7455:39;7427:2;7424:1;7420:10;7415:15;;7391:113;;;7522:6;7519:1;7516:13;7513:101;;;7602:1;7593:6;7588:3;7584:16;7577:27;7513:101;7362:258;7313:307;;;:::o;7626:281::-;7709:27;7731:4;7709:27;:::i;:::-;7701:6;7697:40;7839:6;7827:10;7824:22;7803:18;7791:10;7788:34;7785:62;7782:88;;;7850:18;;:::i;:::-;7782:88;7890:10;7886:2;7879:22;7669:238;7626:281;;:::o;7913:180::-;7961:77;7958:1;7951:88;8058:4;8055:1;8048:15;8082:4;8079:1;8072:15;8099:117;8208:1;8205;8198:12;8222:117;8331:1;8328;8321:12;8345:117;8454:1;8451;8444:12;8468:117;8577:1;8574;8567:12;8591:102;8632:6;8683:2;8679:7;8674:2;8667:5;8663:14;8659:28;8649:38;;8591:102;;;:::o;8699:173::-;8839:25;8835:1;8827:6;8823:14;8816:49;8699:173;:::o;8878:138::-;8959:32;8985:5;8959:32;:::i;:::-;8952:5;8949:43;8939:71;;9006:1;9003;8996:12;8939:71;8878:138;:::o;9022:116::-;9092:21;9107:5;9092:21;:::i;:::-;9085:5;9082:32;9072:60;;9128:1;9125;9118:12;9072:60;9022:116;:::o;9144:122::-;9217:24;9235:5;9217:24;:::i;:::-;9210:5;9207:35;9197:63;;9256:1;9253;9246:12;9197:63;9144:122;:::o
Swarm Source
ipfs://222779659e525d0848993c536e94a9f17c6a2ac33bdf42ff2e958b43847a65d1
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.