ETH Price: $3,569.35 (-0.10%)
Gas: 18 Gwei

Contract

0xBEa7cDfB4b49EC154Ae1c0D731E4DC773A3265aA
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Exit123096282021-04-25 13:05:091068 days ago1619355909IN
Maker: MCD Join COMP A
0 ETH0.0042956759.8
Exit109672182020-10-01 1:21:481275 days ago1601515308IN
Maker: MCD Join COMP A
0 ETH0.00640178101.4
Deny109507622020-09-28 11:39:401277 days ago1601293180IN
Maker: MCD Join COMP A
0 ETH0.00240123141
Rely109324062020-09-25 14:40:291280 days ago1601044829IN
Maker: MCD Join COMP A
0 ETH0.00526859112
0x60806040109323112020-09-25 14:19:081280 days ago1601043548IN
 Contract Creation
0 ETH0.10133773109

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xA6EA3b9C...ca44C0ef9
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
GemJoin

Compiler Version
v0.5.12+commit.7709ece9

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
/**
 *Submitted for verification at Etherscan.io on 2020-07-22
*/

/// join.sol -- Basic 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
                )
        }
    }
}

interface GemLike {
    function decimals() external view returns (uint);
    function transfer(address,uint) external returns (bool);
    function transferFrom(address,address,uint) external returns (bool);
}

interface VatLike {
    function slip(bytes32,address,int) external;
    function move(address,address,uint) external;
}

contract GemJoin 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, "GemJoin/not-authorized");
        _;
    }

    VatLike public vat;   // CDP Engine
    bytes32 public ilk;   // Collateral Type
    GemLike public gem;
    uint    public dec;
    uint    public live;  // Active Flag

    constructor(address vat_, bytes32 ilk_, address gem_) public {
        wards[msg.sender] = 1;
        live = 1;
        vat = VatLike(vat_);
        ilk = ilk_;
        gem = GemLike(gem_);
        dec = gem.decimals();
    }
    function cage() external note auth {
        live = 0;
    }
    function join(address usr, uint wad) external note {
        require(live == 1, "GemJoin/not-live");
        require(int(wad) >= 0, "GemJoin/overflow");
        vat.slip(ilk, usr, int(wad));
        require(gem.transferFrom(msg.sender, address(this), wad), "GemJoin/failed-transfer");
    }
    function exit(address usr, uint wad) external note {
        require(wad <= 2 ** 255, "GemJoin/overflow");
        vat.slip(ilk, msg.sender, -int(wad));
        require(gem.transfer(usr, wad), "GemJoin/failed-transfer");
    }
}

Contract Security Audit

Contract ABI

[{"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":"usr","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 GemLike","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":"usr","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"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063957aa58c11610071578063957aa58c146101de5780639c52a7f1146101fc578063b3bcfa8214610240578063bf353dbb1461025e578063c5ce281e146102b6578063ef693bed146102d4576100a9565b806336569e77146100ae5780633b4da69f146100f857806365fae35e14610146578063692450091461018a5780637bd2bea714610194575b600080fd5b6100b6610322565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101446004803603604081101561010e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610348565b005b6101886004803603602081101561015c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106c3565b005b6101926107f1565b005b61019c6108e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e6610908565b6040518082815260200191505060405180910390f35b61023e6004803603602081101561021257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b005b610248610a3c565b6040518082815260200191505060405180910390f35b6102a06004803603602081101561027457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a42565b6040518082815260200191505060405180910390f35b6102be610a5a565b6040518082815260200191505060405180910390f35b610320600480360360408110156102ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a60565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001600554146103c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f47656d4a6f696e2f6e6f742d6c6976650000000000000000000000000000000081525060200191505060405180910390fd5b6000811215610437576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f47656d4a6f696e2f6f766572666c6f770000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637cdd3fde60025484846040518463ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156104ea57600080fd5b505af11580156104fe573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156105df57600080fd5b505af11580156105f3573d6000803e3d6000fd5b505050506040513d602081101561060957600080fd5b810190808051906020019092919050505061068c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f47656d4a6f696e2f6661696c65642d7472616e7366657200000000000000000081525060200191505060405180910390fd5b5961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a4505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610777576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f47656d4a6f696e2f6e6f742d617574686f72697a65640000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a45050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146108a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f47656d4a6f696e2f6e6f742d617574686f72697a65640000000000000000000081525060200191505060405180910390fd5b60006005819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a450565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146109c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f47656d4a6f696e2f6e6f742d617574686f72697a65640000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a45050565b60045481565b60006020528060005260406000206000915090505481565b60025481565b7f8000000000000000000000000000000000000000000000000000000000000000811115610af6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f47656d4a6f696e2f6f766572666c6f770000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637cdd3fde60025433846000036040518463ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610bac57600080fd5b505af1158015610bc0573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c6d57600080fd5b505af1158015610c81573d6000803e3d6000fd5b505050506040513d6020811015610c9757600080fd5b8101908080519060200190929190505050610d1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f47656d4a6f696e2f6661696c65642d7472616e7366657200000000000000000081525060200191505060405180910390fd5b5961012081016040526020815260e0602082015260e0600060408301376024356004353360003560e01c60e01b61012085a450505056fea265627a7a72315820bf630fa66d49c7cfdc69393b31371fe797bbf91a672066168ebc8a0c1689cdf964736f6c634300050c0032

Deployed Bytecode Sourcemap

2346:1374:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2346:1374:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2699:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3186:295;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3186:295:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2447:65;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2447:65:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;3118:62;;;:::i;:::-;;2786:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2836:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2518:65;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2518:65:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;2811:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2402:38;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2402:38:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2740:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3487:230;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3487:230:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2699:18;;;;;;;;;;;;;:::o;3186:295::-;3264:1;3256:4;;:9;3248:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3317:1;3309:3;3305:13;;3297:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3350:3;;;;;;;;;;;:8;;;3359:3;;3364;3373;3350:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3350:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3350:28:0;;;;3397:3;;;;;;;;;;;:16;;;3414:10;3434:4;3441:3;3397:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3397:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3397:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3397:48:0;;;;;;;;;;;;;;;;3389:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1255:7;1351:3;1345:4;1341:14;1335:4;1328:28;1426:4;1420;1413:18;1518:3;1511:4;1505;1501:15;1494:28;1605:3;1602:1;1595:4;1589;1585:15;1572:37;1927:2;1914:16;1864:1;1851:15;1782:8;1747:1;1734:15;1729:3;1725:25;1720:3;1716:35;1655:3;1649:4;1644:333;1078:910;;;:::o;2447:65::-;2643:1;2622:5;:17;2628:10;2622:17;;;;;;;;;;;;;;;;:22;2614:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2508:1;2495:5;:10;2501:3;2495:10;;;;;;;;;;;;;;;:14;;;;1255:7;1351:3;1345:4;1341:14;1335:4;1328:28;1426:4;1420;1413:18;1518:3;1511:4;1505;1501:15;1494:28;1605:3;1602:1;1595:4;1589;1585:15;1572:37;1927:2;1914:16;1864:1;1851:15;1782:8;1747:1;1734:15;1729:3;1725:25;1720:3;1716:35;1655:3;1649:4;1644:333;1078:910;;:::o;3118:62::-;2643:1;2622:5;:17;2628:10;2622:17;;;;;;;;;;;;;;;;:22;2614:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3171:1;3164:4;:8;;;;1255:7;1351:3;1345:4;1341:14;1335:4;1328:28;1426:4;1420;1413:18;1518:3;1511:4;1505;1501:15;1494:28;1605:3;1602:1;1595:4;1589;1585:15;1572:37;1927:2;1914:16;1864:1;1851:15;1782:8;1747:1;1734:15;1729:3;1725:25;1720:3;1716:35;1655:3;1649:4;1644:333;1078:910;:::o;2786:18::-;;;;;;;;;;;;;:::o;2836:19::-;;;;:::o;2518:65::-;2643:1;2622:5;:17;2628:10;2622:17;;;;;;;;;;;;;;;;:22;2614:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2579:1;2566:5;:10;2572:3;2566:10;;;;;;;;;;;;;;;:14;;;;1255:7;1351:3;1345:4;1341:14;1335:4;1328:28;1426:4;1420;1413:18;1518:3;1511:4;1505;1501:15;1494:28;1605:3;1602:1;1595:4;1589;1585:15;1572:37;1927:2;1914:16;1864:1;1851:15;1782:8;1747:1;1734:15;1729:3;1725:25;1720:3;1716:35;1655:3;1649:4;1644:333;1078:910;;:::o;2811:18::-;;;;:::o;2402:38::-;;;;;;;;;;;;;;;;;:::o;2740:18::-;;;;:::o;3487:230::-;3564:8;3557:3;:15;;3549:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3604:3;;;;;;;;;;;:8;;;3613:3;;3618:10;3635:3;3630:9;;3604:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3604:36:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3604:36:0;;;;3659:3;;;;;;;;;;;:12;;;3672:3;3677;3659:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3659:22:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3659:22:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3659:22:0;;;;;;;;;;;;;;;;3651:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1255:7;1351:3;1345:4;1341:14;1335:4;1328:28;1426:4;1420;1413:18;1518:3;1511:4;1505;1501:15;1494:28;1605:3;1602:1;1595:4;1589;1585:15;1572:37;1927:2;1914:16;1864:1;1851:15;1782:8;1747:1;1734:15;1729:3;1725:25;1720:3;1716:35;1655:3;1649:4;1644:333;1078:910;;;:::o

Swarm Source

bzzr://bf630fa66d49c7cfdc69393b31371fe797bbf91a672066168ebc8a0c1689cdf9

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.