My Name Tag:
Not Available, login to update
[ Download CSV Export ]
View more zero value Internal Transactions in Advanced View mode
Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xa191e578a6736167326d05c119ce0c90849e84b7
Contract Name:
GemJoin5
Compiler Version
v0.5.12+commit.7709ece9
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-03-16 */ /// join.sol -- Non-standard token adapters // Copyright (C) 2018 Rain <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.5.12; contract LibNote { event LogNote( bytes4 indexed sig, address indexed usr, bytes32 indexed arg1, bytes32 indexed arg2, bytes data ) anonymous; modifier note { _; assembly { // log an 'anonymous' event with a constant 6 words of calldata // and four indexed topics: selector, caller, arg1 and arg2 let mark := msize // end of memory ensures zero mstore(0x40, add(mark, 288)) // update free memory pointer mstore(mark, 0x20) // bytes type data offset mstore(add(mark, 0x20), 224) // bytes size (padded) calldatacopy(add(mark, 0x40), 0, 224) // bytes payload log4(mark, 288, // calldata shl(224, shr(224, calldataload(0))), // msg.sig caller, // msg.sender calldataload(4), // arg1 calldataload(36) // arg2 ) } } } contract VatLike { function slip(bytes32,address,int) public; } contract GemLike5 { function decimals() public view returns (uint8); function transfer(address,uint) public returns (bool); function transferFrom(address,address,uint) public returns (bool); } contract GemJoin5 is LibNote { // --- Auth --- mapping (address => uint) public wards; function rely(address usr) external note auth { wards[usr] = 1; } function deny(address usr) external note auth { wards[usr] = 0; } modifier auth { require(wards[msg.sender] == 1); _; } VatLike public vat; bytes32 public ilk; GemLike5 public gem; uint public dec; uint public live; // Access Flag constructor(address vat_, bytes32 ilk_, address gem_) public { gem = GemLike5(gem_); dec = gem.decimals(); require(dec < 18, "GemJoin5/decimals-18-or-higher"); wards[msg.sender] = 1; live = 1; vat = VatLike(vat_); ilk = ilk_; } function cage() external note auth { live = 0; } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "GemJoin5/overflow"); } function join(address urn, uint wad) public note { require(live == 1, "GemJoin5/not-live"); uint wad18 = mul(wad, 10 ** (18 - dec)); require(int(wad18) >= 0, "GemJoin5/overflow"); vat.slip(ilk, urn, int(wad18)); require(gem.transferFrom(msg.sender, address(this), wad), "GemJoin5/failed-transfer"); } function exit(address guy, uint wad) public note { uint wad18 = mul(wad, 10 ** (18 - dec)); require(int(wad18) >= 0, "GemJoin5/overflow"); vat.slip(ilk, msg.sender, -int(wad18)); require(gem.transfer(guy, wad), "GemJoin5/failed-transfer"); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"vat_","type":"address"},{"internalType":"bytes32","name":"ilk_","type":"bytes32"},{"internalType":"address","name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[],"name":"cage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"internalType":"contract GemLike5","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ilk","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"urn","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"join","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"live","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"internalType":"contract VatLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610f52380380610f528339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561010157600080fd5b505afa158015610115573d6000803e3d6000fd5b505050506040513d602081101561012b57600080fd5b810190808051906020019092919050505060ff166004819055506012600454106101bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f47656d4a6f696e352f646563696d616c732d31382d6f722d686967686572000081525060200191505060405180910390fd5b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160058190555082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600281905550505050610cef806102636000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063957aa58c11610071578063957aa58c146101de5780639c52a7f1146101fc578063b3bcfa8214610240578063bf353dbb1461025e578063c5ce281e146102b6578063ef693bed146102d4576100a9565b806336569e77146100ae5780633b4da69f146100f857806365fae35e14610146578063692450091461018a5780637bd2bea714610194575b600080fd5b6100b6610322565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101446004803603604081101561010e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610348565b005b6101886004803603602081101561015c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106da565b005b61019261079f565b005b61019c610827565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e661084d565b6040518082815260200191505060405180910390f35b61023e6004803603602081101561021257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b610248610918565b6040518082815260200191505060405180910390f35b6102a06004803603602081101561027457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061091e565b6040518082815260200191505060405180910390f35b6102be610936565b6040518082815260200191505060405180910390f35b610320600480360360408110156102ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093c565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001600554146103c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47656d4a6f696e352f6e6f742d6c69766500000000000000000000000000000081525060200191505060405180910390fd5b60006103d482600454601203600a0a610c25565b9050600081121561044d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47656d4a6f696e352f6f766572666c6f7700000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637cdd3fde60025485846040518463ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561050057600080fd5b505af1158015610514573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156105f557600080fd5b505af1158015610609573d6000803e3d6000fd5b505050506040513d602081101561061f57600080fd5b81019080805190602001909291905050506106a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f47656d4a6f696e352f6661696c65642d7472616e73666572000000000000000081525060200191505060405180910390fd5b505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a4505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461072557600080fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a45050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146107ea57600080fd5b60006005819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a450565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461089e57600080fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a45050565b60045481565b60006020528060005260406000206000915090505481565b60025481565b600061095082600454601203600a0a610c25565b905060008112156109c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47656d4a6f696e352f6f766572666c6f7700000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637cdd3fde60025433846000036040518463ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610a7f57600080fd5b505af1158015610a93573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b4057600080fd5b505af1158015610b54573d6000803e3d6000fd5b505050506040513d6020811015610b6a57600080fd5b8101908080519060200190929190505050610bed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f47656d4a6f696e352f6661696c65642d7472616e73666572000000000000000081525060200191505060405180910390fd5b505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a4505050565b600080821480610c425750828283850292508281610c3f57fe5b04145b610cb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f47656d4a6f696e352f6f766572666c6f7700000000000000000000000000000081525060200191505060405180910390fd5b9291505056fea265627a7a723158203676abbd154f1472ca3454c0a2e290d9e7814fa9ba859c240deb23484084557064736f6c634300050c003200000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b555344432d410000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Deployed ByteCode Sourcemap
2293:1617:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2293:1617:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2598:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3267:350;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3267:350:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2395:65;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2395:65:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;3050:62;;;:::i;:::-;;2650:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2702:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2466:65;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2466:65:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;2676:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2350:38;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2350:38:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2624:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3625:282;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3625:282:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2598:19;;;;;;;;;;;;;:::o;3267:350::-;3343:1;3335:4;;:9;3327:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3377:10;3390:26;3394:3;3411;;3406:2;:8;3399:2;:16;3390:3;:26::i;:::-;3377:39;;3449:1;3439:5;3435:15;;3427:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3483:3;;;;;;;;;;;:8;;;3492:3;;3497;3506:5;3483:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3483:30:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3483:30:0;;;;3532:3;;;;;;;;;;;:16;;;3549:10;3569:4;3576:3;3532:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3532:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3532:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3532:48:0;;;;;;;;;;;;;;;;3524:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1063:1;1261:5;1357:3;1351:4;1347:14;1341:4;1334:28;1432:4;1426;1419:18;1524:3;1517:4;1511;1507:15;1500:28;1611:3;1608:1;1601:4;1595;1591:15;1578:37;1933:2;1920:16;1870:1;1857:15;1788:6;1753:1;1740:15;1735:3;1731:25;1726:3;1722:35;1661:3;1655:4;1650:333;1084:910;;;:::o;2395:65::-;2582:1;2561:5;:17;2567:10;2561:17;;;;;;;;;;;;;;;;:22;2553:31;;;;;;2456:1;2443:5;:10;2449:3;2443:10;;;;;;;;;;;;;;;:14;;;;1261:5;1357:3;1351:4;1347:14;1341:4;1334:28;1432:4;1426;1419:18;1524:3;1517:4;1511;1507:15;1500:28;1611:3;1608:1;1601:4;1595;1591:15;1578:37;1933:2;1920:16;1870:1;1857:15;1788:6;1753:1;1740:15;1735:3;1731:25;1726:3;1722:35;1661:3;1655:4;1650:333;1084:910;;:::o;3050:62::-;2582:1;2561:5;:17;2567:10;2561:17;;;;;;;;;;;;;;;;:22;2553:31;;;;;;3103:1;3096:4;:8;;;;1261:5;1357:3;1351:4;1347:14;1341:4;1334:28;1432:4;1426;1419:18;1524:3;1517:4;1511;1507:15;1500:28;1611:3;1608:1;1601:4;1595;1591:15;1578:37;1933:2;1920:16;1870:1;1857:15;1788:6;1753:1;1740:15;1735:3;1731:25;1726:3;1722:35;1661:3;1655:4;1650:333;1084:910;:::o;2650:19::-;;;;;;;;;;;;;:::o;2702:20::-;;;;:::o;2466:65::-;2582:1;2561:5;:17;2567:10;2561:17;;;;;;;;;;;;;;;;:22;2553:31;;;;;;2527:1;2514:5;:10;2520:3;2514:10;;;;;;;;;;;;;;;:14;;;;1261:5;1357:3;1351:4;1347:14;1341:4;1334:28;1432:4;1426;1419:18;1524:3;1517:4;1511;1507:15;1500:28;1611:3;1608:1;1601:4;1595;1591:15;1578:37;1933:2;1920:16;1870:1;1857:15;1788:6;1753:1;1740:15;1735:3;1731:25;1726:3;1722:35;1661:3;1655:4;1650:333;1084:910;;:::o;2676:19::-;;;;:::o;2350:38::-;;;;;;;;;;;;;;;;;:::o;2624:19::-;;;;:::o;3625:282::-;3685:10;3698:26;3702:3;3719;;3714:2;:8;3707:2;:16;3698:3;:26::i;:::-;3685:39;;3757:1;3747:5;3743:15;;3735:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3791:3;;;;;;;;;;;:8;;;3800:3;;3805:10;3822:5;3817:11;;3791:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3791:38:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3791:38:0;;;;3848:3;;;;;;;;;;;:12;;;3861:3;3866;3848:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3848:22:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3848:22:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3848:22:0;;;;;;;;;;;;;;;;3840:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1063:1;1261:5;1357:3;1351:4;1347:14;1341:4;1334:28;1432:4;1426;1419:18;1524:3;1517:4;1511;1507:15;1500:28;1611:3;1608:1;1601:4;1595;1591:15;1578:37;1933:2;1920:16;1870:1;1857:15;1788:6;1753:1;1740:15;1735:3;1731:25;1726:3;1722:35;1661:3;1655:4;1650:333;1084:910;;;:::o;3120:139::-;3172:6;3204:1;3199;:6;:30;;;;3228:1;3223;3218;3214;:5;3210:9;;;3209:15;;;;;;:20;3199:30;3191:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3120:139;;;;:::o
Swarm Source
bzzr://3676abbd154f1472ca3454c0a2e290d9e7814fa9ba859c240deb234840845570
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.