Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
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 0x2764978c...6bd4D6730 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
TokenAuthority
Compiler Version
v0.5.8+commit.23d335f2
Contract Source Code (Solidity Multiple files format)
/* This file is part of The Colony Network. The Colony Network 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. The Colony Network 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 The Colony Network. If not, see <http://www.gnu.org/licenses/>. */ pragma solidity 0.5.8; import "auth.sol"; contract TokenAuthority is DSAuthority { address public token; mapping(address => mapping(bytes4 => bool)) authorizations; bytes4 constant BURN_FUNC_SIG = bytes4(keccak256("burn(uint256)")); bytes4 constant BURN_OVERLOAD_FUNC_SIG = bytes4(keccak256("burn(address,uint256)")); constructor(address _token, address _colony, address[] memory allowedToTransfer) public { token = _token; bytes4 transferSig = bytes4(keccak256("transfer(address,uint256)")); bytes4 transferFromSig = bytes4(keccak256("transferFrom(address,address,uint256)")); bytes4 mintSig = bytes4(keccak256("mint(uint256)")); bytes4 mintSigOverload = bytes4(keccak256("mint(address,uint256)")); authorizations[_colony][transferSig] = true; authorizations[_colony][mintSig] = true; authorizations[_colony][mintSigOverload] = true; for (uint i = 0; i < allowedToTransfer.length; i++) { authorizations[allowedToTransfer[i]][transferSig] = true; authorizations[allowedToTransfer[i]][transferFromSig] = true; } } function canCall(address src, address dst, bytes4 sig) public view returns (bool) { if (sig == BURN_FUNC_SIG || sig == BURN_OVERLOAD_FUNC_SIG) { // We allow anyone to burn their own tokens even when the token is still locked return true; } if (dst != token) { return false; } return authorizations[src][sig]; } }
// 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.23; 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 DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; constructor() public { owner = msg.sender; emit LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; emit LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; emit LogSetAuthority(address(authority)); } modifier auth { require(isAuthorized(msg.sender, msg.sig), "ds-auth-unauthorized"); _; } 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, address(this), sig); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_colony","type":"address"},{"name":"allowedToTransfer","type":"address[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b70096131461003b578063fc0c546a146100e0575b600080fd5b6100c66004803603606081101561005157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916906020019092919050505061012a565b604051808215151515815260200191505060405180910390f35b6100e8610330565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600060405180807f6275726e2875696e743235362900000000000000000000000000000000000000815250600d01905060405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061021f575060405180807f6275726e28616464726573732c75696e74323536290000000000000000000000815250601501905060405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b1561022d5760019050610329565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461028a5760009050610329565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff1690505b9392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a72305820740a524cf74a600d9afff2be906a998399eb725cf27266677800ac3553dba6660029
Deployed Bytecode Sourcemap
745:1396:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;745:1396:0;;;;;;;;;;;;;;;;;;;;;;;;1787:352;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1787:352:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;788:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1787:352;1863:4;914:26;;;;;;;;;;;;;;;;;;;1879:20;;;:3;:20;;;;:53;;;;993:34;;;;;;;;;;;;;;;;;;;1903:29;;;:3;:29;;;;1879:53;1875:171;;;2035:4;2028:11;;;;1875:171;2063:5;;;;;;;;;;;2056:12;;:3;:12;;;2052:45;;2085:5;2078:12;;;;2052:45;2110:14;:19;2125:3;2110:19;;;;;;;;;;;;;;;:24;2130:3;2110:24;;;;;;;;;;;;;;;;;;;;;;;;;;;2103:31;;1787:352;;;;;;:::o;788:20::-;;;;;;;;;;;;;:::o
Swarm Source
bzzr://740a524cf74a600d9afff2be906a998399eb725cf27266677800ac3553dba666
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.