Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
13402064 | 1117 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xc0454B57...7ec018515 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DSGuard
Compiler Version
v0.4.25+commit.59dbf8f1
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ /** *Submitted for verification at Etherscan.io on 2019-04-25 */ // guard.sol -- simple whitelist implementation of DSAuthority // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.4.13; contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSGuardEvents { event LogPermit( bytes32 indexed src, bytes32 indexed dst, bytes32 indexed sig ); event LogForbid( bytes32 indexed src, bytes32 indexed dst, bytes32 indexed sig ); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() public { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; LogSetAuthority(authority); } modifier auth { require(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } } contract DSGuard is DSAuth, DSAuthority, DSGuardEvents { bytes32 constant public ANY = bytes32(uint(-1)); mapping (bytes32 => mapping (bytes32 => mapping (bytes32 => bool))) acl; function canCall( address src_, address dst_, bytes4 sig ) public view returns (bool) { var src = bytes32(src_); var dst = bytes32(dst_); return acl[src][dst][sig] || acl[src][dst][ANY] || acl[src][ANY][sig] || acl[src][ANY][ANY] || acl[ANY][dst][sig] || acl[ANY][dst][ANY] || acl[ANY][ANY][sig] || acl[ANY][ANY][ANY]; } function permit(bytes32 src, bytes32 dst, bytes32 sig) public auth { acl[src][dst][sig] = true; LogPermit(src, dst, sig); } function forbid(bytes32 src, bytes32 dst, bytes32 sig) public auth { acl[src][dst][sig] = false; LogForbid(src, dst, sig); } function permit(address src, address dst, bytes32 sig) public { permit(bytes32(src), bytes32(dst), sig); } function forbid(address src, address dst, bytes32 sig) public { forbid(bytes32(src), bytes32(dst), sig); } } contract DSGuardFactory { mapping (address => bool) public isGuard; function newGuard() public returns (DSGuard guard) { guard = new DSGuard(); guard.setOwner(msg.sender); isGuard[guard] = true; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"sig","type":"bytes32"}],"name":"forbid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"sig","type":"bytes32"}],"name":"forbid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ANY","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src_","type":"address"},{"name":"dst_","type":"address"},{"name":"sig","type":"bytes4"}],"name":"canCall","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"sig","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"sig","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"bytes32"},{"indexed":true,"name":"dst","type":"bytes32"},{"indexed":true,"name":"sig","type":"bytes32"}],"name":"LogPermit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"bytes32"},{"indexed":true,"name":"dst","type":"bytes32"},{"indexed":true,"name":"sig","type":"bytes32"}],"name":"LogForbid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]
Deployed Bytecode
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100a95780632bc3217d146100ec57806379d88d871461015d5780637a9e5e4b146101aa5780638da5cb5b146101ed578063a8542f6614610244578063b700961314610277578063bf7e214f1461031b578063cbeea68c14610372578063f0217ce5146103e3575b600080fd5b3480156100b557600080fd5b506100ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610430565b005b3480156100f857600080fd5b5061015b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610512565b005b34801561016957600080fd5b506101a8600480360381019080803560001916906020019092919080356000191690602001909291908035600019169060200190929190505050610554565b005b3480156101b657600080fd5b506101eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610633565b005b3480156101f957600080fd5b50610202610713565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025057600080fd5b50610259610739565b60405180826000191660001916815260200191505060405180910390f35b34801561028357600080fd5b50610301600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561032757600080fd5b50610330610cc1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037e57600080fd5b506103e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610ce6565b005b3480156103ef57600080fd5b5061042e600480360381019080803560001916906020019092919080356000191690602001909291908035600019169060200190929190505050610d28565b005b61045e336000357fffffffff0000000000000000000000000000000000000000000000000000000016610e07565b151561046957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b61054f8373ffffffffffffffffffffffffffffffffffffffff166001028373ffffffffffffffffffffffffffffffffffffffff1660010283610554565b505050565b610582336000357fffffffff0000000000000000000000000000000000000000000000000000000016610e07565b151561058d57600080fd5b6000600260008560001916600019168152602001908152602001600020600084600019166000191681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508060001916826000191684600019167f95ba64c95d85e67ac83a0476c4a62ac2cf8ab2d0407545b8c9d79c3eefa6282960405160405180910390a4505050565b610661336000357fffffffff0000000000000000000000000000000000000000000000000000000016610e07565b151561066c57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60010281565b60008060008573ffffffffffffffffffffffffffffffffffffffff1660010291508473ffffffffffffffffffffffffffffffffffffffff166001029050600260008360001916600019168152602001908152602001600020600082600019166000191681526020019081526020016000206000857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660001916815260200190815260200160002060009054906101000a900460ff168061089857506002600083600019166000191681526020019081526020016000206000826000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060009054906101000a900460ff165b80610938575060026000836000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600102600019166000191681526020019081526020016000206000857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660001916815260200190815260200160002060009054906101000a900460ff165b806109e0575060026000836000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060009054906101000a900460ff165b80610a805750600260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60010260001916600019168152602001908152602001600020600082600019166000191681526020019081526020016000206000857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660001916815260200190815260200160002060009054906101000a900460ff165b80610b285750600260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600102600019166000191681526020019081526020016000206000826000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060009054906101000a900460ff165b80610beb5750600260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600102600019166000191681526020019081526020016000206000857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660001916815260200190815260200160002060009054906101000a900460ff165b80610cb65750600260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001026000191660001916815260200190815260200160002060009054906101000a900460ff165b925050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d238373ffffffffffffffffffffffffffffffffffffffff166001028373ffffffffffffffffffffffffffffffffffffffff1660010283610d28565b505050565b610d56336000357fffffffff0000000000000000000000000000000000000000000000000000000016610e07565b1515610d6157600080fd5b6001600260008560001916600019168152602001908152602001600020600084600019166000191681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508060001916826000191684600019167f6f50375045128971c5469d343039ba7b8e30a5b190453737b28bda6f7a30677160405160405180910390a4505050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e465760019050611078565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ea55760019050611078565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610f045760009050611078565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15801561103a57600080fd5b505af115801561104e573d6000803e3d6000fd5b505050506040513d602081101561106457600080fd5b810190808051906020019092919050505090505b929150505600a165627a7a7230582046fda457ecfe17c7abb4819d79cdddb596634e1bdacfbcb2178c795c9fa363ad0029
Deployed Bytecode Sourcemap
2398:1225:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1619:131;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1619:131:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;3498:120;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3498:120:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3217:147;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3217:147:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1758:159;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1758:159:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;1480:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1480:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;2460:47;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2460:47:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2596:459;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2596:459:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1443:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1443:30:0;;;;;;;;;;;;;;;;;;;;;;;;;;;3372:120;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3372:120:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3063:146;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3063:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1619:131;1958:33;1971:10;1983:7;;;;1958:12;:33::i;:::-;1950:42;;;;;;;;1707:6;1699:5;;:14;;;;;;;;;;;;;;;;;;1736:5;;;;;;;;;;;1724:18;;;;;;;;;;;;1619:131;:::o;3498:120::-;3571:39;3586:3;3578:12;;;;3600:3;3592:12;;;;3606:3;3571:6;:39::i;:::-;3498:120;;;:::o;3217:147::-;1958:33;1971:10;1983:7;;;;1958:12;:33::i;:::-;1950:42;;;;;;;;3316:5;3295:3;:8;3299:3;3295:8;;;;;;;;;;;;;;;;;:13;3304:3;3295:13;;;;;;;;;;;;;;;;;:18;3309:3;3295:18;;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;3352:3;3332:24;;;3347:3;3332:24;;;3342:3;3332:24;;;;;;;;;;;;;3217:147;;;:::o;1758:159::-;1958:33;1971:10;1983:7;;;;1958:12;:33::i;:::-;1950:42;;;;;;;;1862:10;1850:9;;:22;;;;;;;;;;;;;;;;;;1899:9;;;;;;;;;;;1883:26;;;;;;;;;;;;1758:159;:::o;1480:26::-;;;;;;;;;;;;;:::o;2460:47::-;2503:2;2490:17;;2460:47;:::o;2596:459::-;2690:4;2707:7;2741;2725:4;2717:13;;;;2707:23;;2759:4;2751:13;;;;2741:23;;2784:3;:8;2788:3;2784:8;;;;;;;;;;;;;;;;;:13;2793:3;2784:13;;;;;;;;;;;;;;;;;:18;2798:3;2784:18;;;;;;;;;;;;;;;;;;;;;;;;;;;:53;;;;2819:3;:8;2823:3;2819:8;;;;;;;;;;;;;;;;;:13;2828:3;2819:13;;;;;;;;;;;;;;;;;:18;2503:2;2490:17;;2819:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:53;:88;;;;2854:3;:8;2858:3;2854:8;;;;;;;;;;;;;;;;;:13;2503:2;2490:17;;2854:13;;;;;;;;;;;;;;;;;:18;2868:3;2854:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:88;:123;;;;2889:3;:8;2893:3;2889:8;;;;;;;;;;;;;;;;;:13;2503:2;2490:17;;2889:13;;;;;;;;;;;;;;;;;:18;2503:2;2490:17;;2889:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:123;:158;;;;2924:3;:8;2503:2;2490:17;;2924:8;;;;;;;;;;;;;;;;;:13;2933:3;2924:13;;;;;;;;;;;;;;;;;:18;2938:3;2924:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:158;:193;;;;2959:3;:8;2503:2;2490:17;;2959:8;;;;;;;;;;;;;;;;;:13;2968:3;2959:13;;;;;;;;;;;;;;;;;:18;2503:2;2490:17;;2959:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:193;:228;;;;2994:3;:8;2503:2;2490:17;;2994:8;;;;;;;;;;;;;;;;;:13;2503:2;2490:17;;2994:13;;;;;;;;;;;;;;;;;:18;3008:3;2994:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:228;:263;;;;3029:3;:8;2503:2;2490:17;;3029:8;;;;;;;;;;;;;;;;;:13;2503:2;2490:17;;3029:13;;;;;;;;;;;;;;;;;:18;2503:2;2490:17;;3029:18;;;;;;;;;;;;;;;;;;;;;;;;;;;2784:263;2777:270;;2596:459;;;;;;;:::o;1443:30::-;;;;;;;;;;;;;:::o;3372:120::-;3445:39;3460:3;3452:12;;;;3474:3;3466:12;;;;3480:3;3445:6;:39::i;:::-;3372:120;;;:::o;3063:146::-;1958:33;1971:10;1983:7;;;;1958:12;:33::i;:::-;1950:42;;;;;;;;3162:4;3141:3;:8;3145:3;3141:8;;;;;;;;;;;;;;;;;:13;3150:3;3141:13;;;;;;;;;;;;;;;;;:18;3155:3;3141:18;;;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;3197:3;3177:24;;;3192:3;3177:24;;;3187:3;3177:24;;;;;;;;;;;;;3063:146;;;:::o;2020:371::-;2090:4;2126;2111:20;;:3;:20;;;2107:277;;;2155:4;2148:11;;;;2107:277;2188:5;;;;;;;;;;;2181:12;;:3;:12;;;2177:207;;;2217:4;2210:11;;;;2177:207;2268:1;2243:27;;:9;;;;;;;;;;;:27;;;2239:145;;;2294:5;2287:12;;;;2239:145;2339:9;;;;;;;;;;;:17;;;2357:3;2362:4;2368:3;2339:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2339:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2339:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2339:33:0;;;;;;;;;;;;;;;;2332:40;;2020:371;;;;;:::o
Swarm Source
bzzr://46fda457ecfe17c7abb4819d79cdddb596634e1bdacfbcb2178c795c9fa363ad
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.