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 8 from a total of 8 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Unblock | 8271420 | 1891 days ago | IN | 0 ETH | 0.0000584 | ||||
Unblock | 8264126 | 1892 days ago | IN | 0 ETH | 0.00038934 | ||||
Request Transfer | 8263830 | 1892 days ago | IN | 0 ETH | 0.0021673 | ||||
Block Wallet | 8258775 | 1893 days ago | IN | 0 ETH | 0.00049469 | ||||
Block Wallet | 8258759 | 1893 days ago | IN | 0 ETH | 0.00049469 | ||||
Unblock | 8258735 | 1893 days ago | IN | 0 ETH | 0.00019467 | ||||
Block Wallet | 8258701 | 1893 days ago | IN | 0 ETH | 0.00049469 | ||||
0x60806040 | 8258660 | 1893 days ago | IN | 0 ETH | 0.02278488 |
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 0xf19Eab58...7522c2bf4 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
PrintLimiter
Compiler Version
v0.5.10+commit.5a6ea5b1
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-07-31 */ pragma solidity ^0.5.10; /** @title A contract for generating unique identifiers * * @notice A contract that provides a identifier generation scheme, * guaranteeing uniqueness across all contracts that inherit from it, * as well as unpredictability of future identifiers. * * @dev This contract is intended to be inherited by any contract that * implements the callback software pattern for cooperative custodianship. * */ contract LockRequestable { // MEMBERS /// @notice the count of all invocations of `generateLockId`. uint256 public lockRequestCount; // CONSTRUCTOR constructor() public { lockRequestCount = 0; } // FUNCTIONS /** @notice Returns a fresh unique identifier. * * @dev the generation scheme uses three components. * First, the blockhash of the previous block. * Second, the deployed address. * Third, the next value of the counter. * This ensure that identifiers are unique across all contracts * following this scheme, and that future identifiers are * unpredictable. * * @return a 32-byte unique identifier. */ function generateLockId() internal returns (bytes32 lockId) { return keccak256(abi.encodePacked(blockhash(block.number - 1), address(this), ++lockRequestCount)); } } contract ERC20Interface { // METHODS // NOTE: // public getter functions are not currently recognised as an // implementation of the matching abstract function by the compiler. // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#name // function name() public view returns (string); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#symbol // function symbol() public view returns (string); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#totalsupply // function decimals() public view returns (uint8); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#totalsupply function totalSupply() public view returns (uint256); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#balanceof function balanceOf(address _owner) public view returns (uint256 balance); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transfer function transfer(address _to, uint256 _value) public returns (bool success); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transferfrom function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#approve function approve(address _spender, uint256 _value) public returns (bool success); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#allowance function allowance(address _owner, address _spender) public view returns (uint256 remaining); // EVENTS // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transfer-1 event Transfer(address indexed _from, address indexed _to, uint256 _value); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#approval event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** @title A dual control contract. * * @notice A general purpose contract that implements dual control over * co-operating contracts through a callback mechanism. * * @dev This contract implements dual control through a 2-of-N * threshold multi-signature scheme. The contract recognizes a set of N signers, * and will unlock requests with signatures from any distinct pair of them. * This contract signals the unlocking through a co-operative callback * scheme. * This contract also provides time lock and revocation features. * Requests made by a 'primary' account have a default time lock applied. * All other request must pay a 1 ETH stake and have an extended time lock * applied. * A request that is completed will prevent all previous pending requests * that share the same callback from being completed: this is the * revocation feature. * */ contract Custodian { // TYPES /** @dev The `Request` struct stores a pending unlocking. * `callbackAddress` and `callbackSelector` are the data required to * make a callback. The custodian completes the process by * calling `callbackAddress.call(callbackSelector, lockId)`, which * signals to the contract co-operating with the Custodian that * the 2-of-N signatures have been provided and verified. */ struct Request { bytes32 lockId; bytes4 callbackSelector; // bytes4 and address can be packed into 1 word address callbackAddress; uint256 idx; uint256 timestamp; bool extended; } // EVENTS /// @dev Emitted by successful `requestUnlock` calls. event Requested( bytes32 _lockId, address _callbackAddress, bytes4 _callbackSelector, uint256 _nonce, address _whitelistedAddress, bytes32 _requestMsgHash, uint256 _timeLockExpiry ); /// @dev Emitted by `completeUnlock` calls on requests in the time-locked state. event TimeLocked( uint256 _timeLockExpiry, bytes32 _requestMsgHash ); /// @dev Emitted by successful `completeUnlock` calls. event Completed( bytes32 _lockId, bytes32 _requestMsgHash, address _signer1, address _signer2 ); /// @dev Emitted by `completeUnlock` calls where the callback failed. event Failed( bytes32 _lockId, bytes32 _requestMsgHash, address _signer1, address _signer2 ); /// @dev Emitted by successful `extendRequestTimeLock` calls. event TimeLockExtended( uint256 _timeLockExpiry, bytes32 _requestMsgHash ); // MEMBERS /** @dev The count of all requests. * This value is used as a nonce, incorporated into the request hash. */ uint256 public requestCount; /// @dev The set of signers: signatures from two signers unlock a pending request. mapping (address => bool) public signerSet; /// @dev The map of request hashes to pending requests. mapping (bytes32 => Request) public requestMap; /// @dev The map of callback addresses to callback selectors to request indexes. mapping (address => mapping (bytes4 => uint256)) public lastCompletedIdxs; /** @dev The default period of time (in seconds) to time-lock requests. * All requests will be subject to this default time lock, and the duration * is fixed at contract creation. */ uint256 public defaultTimeLock; /** @dev The extended period of time (in seconds) to time-lock requests. * Requests not from the primary account are subject to this time lock. * The primary account may also elect to extend the time lock on requests * that originally received the default. */ uint256 public extendedTimeLock; /// @dev The primary account is the privileged account for making requests. address public primary; // CONSTRUCTOR constructor( address[] memory _signers, uint256 _defaultTimeLock, uint256 _extendedTimeLock, address _primary ) public { // check for at least two `_signers` require(_signers.length >= 2); // validate time lock params require(_defaultTimeLock <= _extendedTimeLock); defaultTimeLock = _defaultTimeLock; extendedTimeLock = _extendedTimeLock; primary = _primary; // explicitly initialize `requestCount` to zero requestCount = 0; // turn the array into a set for (uint i = 0; i < _signers.length; i++) { // no zero addresses or duplicates require(_signers[i] != address(0) && !signerSet[_signers[i]]); signerSet[_signers[i]] = true; } } // MODIFIERS modifier onlyPrimary { require(msg.sender == primary); _; } // METHODS /** @notice Requests an unlocking with a lock identifier and a callback. * * @dev If called by an account other than the primary a 1 ETH stake * must be paid. This is an anti-spam measure. As well as the callback * and the lock identifier parameters a 'whitelisted address' is required * for compatibility with existing signature schemes. * * @param _lockId The identifier of a pending request in a co-operating contract. * @param _callbackAddress The address of a co-operating contract. * @param _callbackSelector The function selector of a function within * the co-operating contract at address `_callbackAddress`. * @param _whitelistedAddress An address whitelisted in existing * offline control protocols. * * @return requestMsgHash The hash of a request message to be signed. */ function requestUnlock( bytes32 _lockId, address _callbackAddress, bytes4 _callbackSelector, address _whitelistedAddress ) public payable returns (bytes32 requestMsgHash) { require(msg.sender == primary || msg.value >= 1 ether); // disallow using a zero value for the callback address require(_callbackAddress != address(0)); uint256 requestIdx = ++requestCount; // compute a nonce value // - the blockhash prevents prediction of future nonces // - the address of this contract prevents conflicts with co-operating contracts using this scheme // - the counter prevents conflicts arising from multiple txs within the same block uint256 nonce = uint256(keccak256(abi.encodePacked(blockhash(block.number - 1), address(this), requestIdx))); requestMsgHash = keccak256( abi.encodePacked( nonce, _whitelistedAddress, uint256(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) ) ); requestMap[requestMsgHash] = Request({ lockId: _lockId, callbackSelector: _callbackSelector, callbackAddress: _callbackAddress, idx: requestIdx, timestamp: block.timestamp, extended: false }); // compute the expiry time uint256 timeLockExpiry = block.timestamp; if (msg.sender == primary) { timeLockExpiry += defaultTimeLock; } else { timeLockExpiry += extendedTimeLock; // any sender that is not the creator will get the extended time lock requestMap[requestMsgHash].extended = true; } emit Requested(_lockId, _callbackAddress, _callbackSelector, nonce, _whitelistedAddress, requestMsgHash, timeLockExpiry); } /** @notice Completes a pending unlocking with two signatures. * * @dev Given a request message hash as two signatures of it from * two distinct signers in the signer set, this function completes the * unlocking of the pending request by executing the callback. * * @param _requestMsgHash The request message hash of a pending request. * @param _recoveryByte1 The public key recovery byte (27 or 28) * @param _ecdsaR1 The R component of an ECDSA signature (R, S) pair * @param _ecdsaS1 The S component of an ECDSA signature (R, S) pair * @param _recoveryByte2 The public key recovery byte (27 or 28) * @param _ecdsaR2 The R component of an ECDSA signature (R, S) pair * @param _ecdsaS2 The S component of an ECDSA signature (R, S) pair * * @return success True if the callback successfully executed. */ function completeUnlock( bytes32 _requestMsgHash, uint8 _recoveryByte1, bytes32 _ecdsaR1, bytes32 _ecdsaS1, uint8 _recoveryByte2, bytes32 _ecdsaR2, bytes32 _ecdsaS2 ) public returns (bool success) { Request storage request = requestMap[_requestMsgHash]; // copy storage to locals before `delete` bytes32 lockId = request.lockId; address callbackAddress = request.callbackAddress; bytes4 callbackSelector = request.callbackSelector; // failing case of the lookup if the callback address is zero require(callbackAddress != address(0)); // reject confirms of earlier withdrawals buried under later confirmed withdrawals require(request.idx > lastCompletedIdxs[callbackAddress][callbackSelector]); address signer1 = ecrecover( keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _requestMsgHash)), _recoveryByte1, _ecdsaR1, _ecdsaS1 ); require(signerSet[signer1]); address signer2 = ecrecover( keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _requestMsgHash)), _recoveryByte2, _ecdsaR2, _ecdsaS2 ); require(signerSet[signer2]); require(signer1 != signer2); if (request.extended && ((block.timestamp - request.timestamp) < extendedTimeLock)) { emit TimeLocked(request.timestamp + extendedTimeLock, _requestMsgHash); return false; } else if ((block.timestamp - request.timestamp) < defaultTimeLock) { emit TimeLocked(request.timestamp + defaultTimeLock, _requestMsgHash); return false; } else { if (address(this).balance > 0) { // reward sender with anti-spam payments // ignore send success (assign to `success` but this will be overwritten) success = msg.sender.send(address(this).balance); } // raise the waterline for the last completed unlocking lastCompletedIdxs[callbackAddress][callbackSelector] = request.idx; // and delete the request delete requestMap[_requestMsgHash]; // invoke callback (success,) = callbackAddress.call(abi.encodeWithSelector(callbackSelector, lockId)); if (success) { emit Completed(lockId, _requestMsgHash, signer1, signer2); } else { emit Failed(lockId, _requestMsgHash, signer1, signer2); } } } /** @notice Reclaim the storage of a pending request that is uncompleteable. * * @dev If a pending request shares the callback (address and selector) of * a later request has has been completed, then the request can no longer * be completed. This function will reclaim the contract storage of the * pending request. * * @param _requestMsgHash The request message hash of a pending request. */ function deleteUncompletableRequest(bytes32 _requestMsgHash) public { Request storage request = requestMap[_requestMsgHash]; uint256 idx = request.idx; require(0 < idx && idx < lastCompletedIdxs[request.callbackAddress][request.callbackSelector]); delete requestMap[_requestMsgHash]; } /** @notice Extend the time lock of a pending request. * * @dev Requests made by the primary account receive the default time lock. * This function allows the primary account to apply the extended time lock * to one its own requests. * * @param _requestMsgHash The request message hash of a pending request. */ function extendRequestTimeLock(bytes32 _requestMsgHash) public onlyPrimary { Request storage request = requestMap[_requestMsgHash]; // reject ‘null’ results from the map lookup // this can only be the case if an unknown `_requestMsgHash` is received require(request.callbackAddress != address(0)); // `extendRequestTimeLock` must be idempotent require(request.extended != true); // set the `extended` flag; note that this is never unset request.extended = true; emit TimeLockExtended(request.timestamp + extendedTimeLock, _requestMsgHash); } } /** @title A contract to inherit upgradeable custodianship. * * @notice A contract that provides re-usable code for upgradeable * custodianship. That custodian may be an account or another contract. * * @dev This contract is intended to be inherited by any contract * requiring a custodian to control some aspect of its functionality. * This contract provides the mechanism for that custodianship to be * passed from one custodian to the next. * */ contract CustodianUpgradeable is LockRequestable { // TYPES /// @dev The struct type for pending custodian changes. struct CustodianChangeRequest { address proposedNew; } // MEMBERS /// @dev The address of the account or contract that acts as the custodian. address public custodian; /// @dev The map of lock ids to pending custodian changes. mapping (bytes32 => CustodianChangeRequest) public custodianChangeReqs; // CONSTRUCTOR constructor( address _custodian ) LockRequestable() public { custodian = _custodian; } // MODIFIERS modifier onlyCustodian { require(msg.sender == custodian); _; } // PUBLIC FUNCTIONS // (UPGRADE) /** @notice Requests a change of the custodian associated with this contract. * * @dev Returns a unique lock id associated with the request. * Anyone can call this function, but confirming the request is authorized * by the custodian. * * @param _proposedCustodian The address of the new custodian. * @return lockId A unique identifier for this request. */ function requestCustodianChange(address _proposedCustodian) public returns (bytes32 lockId) { require(_proposedCustodian != address(0)); lockId = generateLockId(); custodianChangeReqs[lockId] = CustodianChangeRequest({ proposedNew: _proposedCustodian }); emit CustodianChangeRequested(lockId, msg.sender, _proposedCustodian); } /** @notice Confirms a pending change of the custodian associated with this contract. * * @dev When called by the current custodian with a lock id associated with a * pending custodian change, the `address custodian` member will be updated with the * requested address. * * @param _lockId The identifier of a pending change request. */ function confirmCustodianChange(bytes32 _lockId) public onlyCustodian { custodian = getCustodianChangeReq(_lockId); delete custodianChangeReqs[_lockId]; emit CustodianChangeConfirmed(_lockId, custodian); } // PRIVATE FUNCTIONS function getCustodianChangeReq(bytes32 _lockId) private view returns (address _proposedNew) { CustodianChangeRequest storage changeRequest = custodianChangeReqs[_lockId]; // reject ‘null’ results from the map lookup // this can only be the case if an unknown `_lockId` is received require(changeRequest.proposedNew != address(0)); return changeRequest.proposedNew; } //EVENTS /// @dev Emitted by successful `requestCustodianChange` calls. event CustodianChangeRequested( bytes32 _lockId, address _msgSender, address _proposedCustodian ); /// @dev Emitted by successful `confirmCustodianChange` calls. event CustodianChangeConfirmed(bytes32 _lockId, address _newCustodian); } /** @title A contract to inherit upgradeable token implementations. * * @notice A contract that provides re-usable code for upgradeable * token implementations. It itself inherits from `CustodianUpgradable` * as the upgrade process is controlled by the custodian. * * @dev This contract is intended to be inherited by any contract * requiring a reference to the active token implementation, either * to delegate calls to it, or authorize calls from it. This contract * provides the mechanism for that implementation to be be replaced, * which constitutes an implementation upgrade. * */ contract ERC20ImplUpgradeable is CustodianUpgradeable { // TYPES /// @dev The struct type for pending implementation changes. struct ImplChangeRequest { address proposedNew; } // MEMBERS // @dev The reference to the active token implementation. ERC20Impl public erc20Impl; /// @dev The map of lock ids to pending implementation changes. mapping (bytes32 => ImplChangeRequest) public implChangeReqs; // CONSTRUCTOR constructor(address _custodian) CustodianUpgradeable(_custodian) public { erc20Impl = ERC20Impl(0x0); } // MODIFIERS modifier onlyImpl { require(msg.sender == address(erc20Impl)); _; } // PUBLIC FUNCTIONS // (UPGRADE) /** @notice Requests a change of the active implementation associated * with this contract. * * @dev Returns a unique lock id associated with the request. * Anyone can call this function, but confirming the request is authorized * by the custodian. * * @param _proposedImpl The address of the new active implementation. * @return lockId A unique identifier for this request. */ function requestImplChange(address _proposedImpl) public returns (bytes32 lockId) { require(_proposedImpl != address(0)); lockId = generateLockId(); implChangeReqs[lockId] = ImplChangeRequest({ proposedNew: _proposedImpl }); emit ImplChangeRequested(lockId, msg.sender, _proposedImpl); } /** @notice Confirms a pending change of the active implementation * associated with this contract. * * @dev When called by the custodian with a lock id associated with a * pending change, the `ERC20Impl erc20Impl` member will be updated * with the requested address. * * @param _lockId The identifier of a pending change request. */ function confirmImplChange(bytes32 _lockId) public onlyCustodian { erc20Impl = getImplChangeReq(_lockId); delete implChangeReqs[_lockId]; emit ImplChangeConfirmed(_lockId, address(erc20Impl)); } // PRIVATE FUNCTIONS function getImplChangeReq(bytes32 _lockId) private view returns (ERC20Impl _proposedNew) { ImplChangeRequest storage changeRequest = implChangeReqs[_lockId]; // reject ‘null’ results from the map lookup // this can only be the case if an unknown `_lockId` is received require(changeRequest.proposedNew != address(0)); return ERC20Impl(changeRequest.proposedNew); } //EVENTS /// @dev Emitted by successful `requestImplChange` calls. event ImplChangeRequested( bytes32 _lockId, address _msgSender, address _proposedImpl ); /// @dev Emitted by successful `confirmImplChange` calls. event ImplChangeConfirmed(bytes32 _lockId, address _newImpl); } /** @title Public interface to ERC20 compliant token. * * @notice This contract is a permanent entry point to an ERC20 compliant * system of contracts. * * @dev This contract contains no business logic and instead * delegates to an instance of ERC20Impl. This contract also has no storage * that constitutes the operational state of the token. This contract is * upgradeable in the sense that the `custodian` can update the * `erc20Impl` address, thus redirecting the delegation of business logic. * The `custodian` is also authorized to pass custodianship. * */ contract ERC20Proxy is ERC20Interface, ERC20ImplUpgradeable { // MEMBERS /// @notice Returns the name of the token. string public name; /// @notice Returns the symbol of the token. string public symbol; /// @notice Returns the number of decimals the token uses. uint8 public decimals; // CONSTRUCTOR constructor( string memory _name, string memory _symbol, uint8 _decimals, address _custodian ) ERC20ImplUpgradeable(_custodian) public { name = _name; symbol = _symbol; decimals = _decimals; } // PUBLIC FUNCTIONS // (ERC20Interface) /** @notice Returns the total token supply. * * @return the total token supply. */ function totalSupply() public view returns (uint256) { return erc20Impl.totalSupply(); } /** @notice Returns the account balance of another account with address * `_owner`. * * @return balance the balance of account with address `_owner`. */ function balanceOf(address _owner) public view returns (uint256 balance) { return erc20Impl.balanceOf(_owner); } /** @dev Internal use only. */ function emitTransfer(address _from, address _to, uint256 _value) public onlyImpl { emit Transfer(_from, _to, _value); } /** @notice Transfers `_value` amount of tokens to address `_to`. * * @dev Will fire the `Transfer` event. Will revert if the `_from` * account balance does not have enough tokens to spend. * * @return success true if transfer completes. */ function transfer(address _to, uint256 _value) public returns (bool success) { require(erc20Impl.blocked(msg.sender) != true ); require(erc20Impl.blocked(_to) != true ); return erc20Impl.transferWithSender(msg.sender, _to, _value); } /** @notice Transfers `_value` amount of tokens from address `_from` * to address `_to`. * * @dev Will fire the `Transfer` event. Will revert unless the `_from` * account has deliberately authorized the sender of the message * via some mechanism. * * @return success true if transfer completes. */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(erc20Impl.blocked(msg.sender) != true ); require(erc20Impl.blocked(_from) != true ); require(erc20Impl.blocked(_to) != true ); return erc20Impl.transferFromWithSender(msg.sender, _from, _to, _value); } /** @dev Internal use only. */ function emitApproval(address _owner, address _spender, uint256 _value) public onlyImpl { emit Approval(_owner, _spender, _value); } /** @notice Allows `_spender` to withdraw from your account multiple times, * up to the `_value` amount. If this function is called again it * overwrites the current allowance with _value. * * @dev Will fire the `Approval` event. * * @return success true if approval completes. */ function approve(address _spender, uint256 _value) public returns (bool success) { require(erc20Impl.blocked(msg.sender) != true); require(erc20Impl.blocked(_spender) != true ); return erc20Impl.approveWithSender(msg.sender, _spender, _value); } /** @notice Increases the amount `_spender` is allowed to withdraw from * your account. * This function is implemented to avoid the race condition in standard * ERC20 contracts surrounding the `approve` method. * * @dev Will fire the `Approval` event. This function should be used instead of * `approve`. * * @return success true if approval completes. */ function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) { require(erc20Impl.blocked(msg.sender) != true); require(erc20Impl.blocked(_spender) != true ); return erc20Impl.increaseApprovalWithSender(msg.sender, _spender, _addedValue); } /** @notice Decreases the amount `_spender` is allowed to withdraw from * your account. This function is implemented to avoid the race * condition in standard ERC20 contracts surrounding the `approve` method. * * @dev Will fire the `Approval` event. This function should be used * instead of `approve`. * * @return success true if approval completes. */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) { require(erc20Impl.blocked(msg.sender) != true); require(erc20Impl.blocked(_spender) != true ); return erc20Impl.decreaseApprovalWithSender(msg.sender, _spender, _subtractedValue); } /** @notice Returns how much `_spender` is currently allowed to spend from * `_owner`'s balance. * * @return remaining the remaining allowance. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return erc20Impl.allowance(_owner, _spender); } } /** @title ERC20 compliant token balance store. * * @notice This contract serves as the store of balances, allowances, and * supply for the ERC20 compliant token. No business logic exists here. * * @dev This contract contains no business logic and instead * is the final destination for any change in balances, allowances, or token * supply. This contract is upgradeable in the sense that its custodian can * update the `erc20Impl` address, thus redirecting the source of logic that * determines how the balances will be updated. * */ contract ERC20Store is ERC20ImplUpgradeable { // MEMBERS /// @dev The total token supply. uint256 public totalSupply; /// @dev The mapping of balances. mapping (address => uint256) public balances; /// @dev The mapping of allowances. mapping (address => mapping (address => uint256)) public allowed; // CONSTRUCTOR constructor(address _custodian) ERC20ImplUpgradeable(_custodian) public { totalSupply = 0; } // PUBLIC FUNCTIONS // (ERC20 Ledger) /** @notice The function to set the total supply of tokens. * * @dev Intended for use by token implementation functions * that update the total supply. The only authorized caller * is the active implementation. * * @param _newTotalSupply the value to set as the new total supply */ function setTotalSupply( uint256 _newTotalSupply ) public onlyImpl { totalSupply = _newTotalSupply; } /** @notice Sets how much `_owner` allows `_spender` to transfer on behalf * of `_owner`. * * @dev Intended for use by token implementation functions * that update spending allowances. The only authorized caller * is the active implementation. * * @param _owner The account that will allow an on-behalf-of spend. * @param _spender The account that will spend on behalf of the owner. * @param _value The limit of what can be spent. */ function setAllowance( address _owner, address _spender, uint256 _value ) public onlyImpl { allowed[_owner][_spender] = _value; } /** @notice Sets the balance of `_owner` to `_newBalance`. * * @dev Intended for use by token implementation functions * that update balances. The only authorized caller * is the active implementation. * * @param _owner The account that will hold a new balance. * @param _newBalance The balance to set. */ function setBalance( address _owner, uint256 _newBalance ) public onlyImpl { balances[_owner] = _newBalance; } /** @notice Adds `_balanceIncrease` to `_owner`'s balance. * * @dev Intended for use by token implementation functions * that update balances. The only authorized caller * is the active implementation. * WARNING: the caller is responsible for preventing overflow. * * @param _owner The account that will hold a new balance. * @param _balanceIncrease The balance to add. */ function addBalance( address _owner, uint256 _balanceIncrease ) public onlyImpl { balances[_owner] = balances[_owner] + _balanceIncrease; } } /** @title ERC20 compliant token intermediary contract holding core logic. * * @notice This contract serves as an intermediary between the exposed ERC20 * interface in ERC20Proxy and the store of balances in ERC20Store. This * contract contains core logic that the proxy can delegate to * and that the store is called by. * * @dev This contract contains the core logic to implement the * ERC20 specification as well as several extensions. * 1. Changes to the token supply. * 2. Batched transfers. * 3. Relative changes to spending approvals. * 4. Delegated transfer control ('sweeping'). * */ contract ERC20Impl is CustodianUpgradeable { // TYPES /// @dev The struct type for pending increases to the token supply (print). struct PendingPrint { address receiver; uint256 value; } // MEMBERS /// @dev The reference to the proxy. ERC20Proxy public erc20Proxy; /// @dev The reference to the store. ERC20Store public erc20Store; /// @dev The sole authorized caller of delegated transfer control ('sweeping'). address public sweeper; /** @dev The static message to be signed by an external account that * signifies their permission to forward their balance to any arbitrary * address. This is used to consolidate the control of all accounts * backed by a shared keychain into the control of a single key. * Initialized as the concatenation of the address of this contract * and the word "sweep". This concatenation is done to prevent a replay * attack in a subsequent contract, where the sweep message could * potentially be replayed to re-enable sweeping ability. */ bytes32 public sweepMsg; /** @dev The mapping that stores whether the address in question has * enabled sweeping its contents to another account or not. * If an address maps to "true", it has already enabled sweeping, * and thus does not need to re-sign the `sweepMsg` to enact the sweep. */ mapping (address => bool) public sweptSet; /// @dev The map of lock ids to pending token increases. mapping (bytes32 => PendingPrint) public pendingPrintMap; /// @dev The map of blocked addresses. mapping (address => bool) public blocked; // CONSTRUCTOR constructor( address _erc20Proxy, address _erc20Store, address _custodian, address _sweeper ) CustodianUpgradeable(_custodian) public { require(_sweeper != address(0)); erc20Proxy = ERC20Proxy(_erc20Proxy); erc20Store = ERC20Store(_erc20Store); sweeper = _sweeper; sweepMsg = keccak256(abi.encodePacked(address(this), "sweep")); } // MODIFIERS modifier onlyProxy { require(msg.sender == address(erc20Proxy)); _; } modifier onlySweeper { require(msg.sender == sweeper); _; } /** @notice Core logic of the ERC20 `approve` function. * * @dev This function can only be called by the referenced proxy, * which has an `approve` function. * Every argument passed to that function as well as the original * `msg.sender` gets passed to this function. * NOTE: approvals for the zero address (unspendable) are disallowed. * * @param _sender The address initiating the approval in proxy. */ function approveWithSender( address _sender, address _spender, uint256 _value ) public onlyProxy returns (bool success) { require(_spender != address(0)); erc20Store.setAllowance(_sender, _spender, _value); erc20Proxy.emitApproval(_sender, _spender, _value); return true; } /** @notice Core logic of the `increaseApproval` function. * * @dev This function can only be called by the referenced proxy, * which has an `increaseApproval` function. * Every argument passed to that function as well as the original * `msg.sender` gets passed to this function. * NOTE: approvals for the zero address (unspendable) are disallowed. * * @param _sender The address initiating the approval. */ function increaseApprovalWithSender( address _sender, address _spender, uint256 _addedValue ) public onlyProxy returns (bool success) { require(_spender != address(0)); uint256 currentAllowance = erc20Store.allowed(_sender, _spender); uint256 newAllowance = currentAllowance + _addedValue; require(newAllowance >= currentAllowance); erc20Store.setAllowance(_sender, _spender, newAllowance); erc20Proxy.emitApproval(_sender, _spender, newAllowance); return true; } /** @notice Core logic of the `decreaseApproval` function. * * @dev This function can only be called by the referenced proxy, * which has a `decreaseApproval` function. * Every argument passed to that function as well as the original * `msg.sender` gets passed to this function. * NOTE: approvals for the zero address (unspendable) are disallowed. * * @param _sender The address initiating the approval. */ function decreaseApprovalWithSender( address _sender, address _spender, uint256 _subtractedValue ) public onlyProxy returns (bool success) { require(_spender != address(0)); // disallow unspendable approvals uint256 currentAllowance = erc20Store.allowed(_sender, _spender); uint256 newAllowance = currentAllowance - _subtractedValue; require(newAllowance <= currentAllowance); erc20Store.setAllowance(_sender, _spender, newAllowance); erc20Proxy.emitApproval(_sender, _spender, newAllowance); return true; } /** @notice Requests an increase in the token supply, with the newly created * tokens to be added to the balance of the specified account. * * @dev Returns a unique lock id associated with the request. * Anyone can call this function, but confirming the request is authorized * by the custodian. * NOTE: printing to the zero address is disallowed. * * @param _receiver The receiving address of the print, if confirmed. * @param _value The number of tokens to add to the total supply and the * balance of the receiving address, if confirmed. * * @return lockId A unique identifier for this request. */ function requestPrint(address _receiver, uint256 _value) public returns (bytes32 lockId) { require(_receiver != address(0)); lockId = generateLockId(); pendingPrintMap[lockId] = PendingPrint({ receiver: _receiver, value: _value }); emit PrintingLocked(lockId, _receiver, _value); } /** @notice Confirms a pending increase in the token supply. * * @dev When called by the custodian with a lock id associated with a * pending increase, the amount requested to be printed in the print request * is printed to the receiving address specified in that same request. * NOTE: this function will not execute any print that would overflow the * total supply, but it will not revert either. * * @param _lockId The identifier of a pending print request. */ function confirmPrint(bytes32 _lockId) public onlyCustodian { PendingPrint storage print = pendingPrintMap[_lockId]; // reject ‘null’ results from the map lookup // this can only be the case if an unknown `_lockId` is received address receiver = print.receiver; require (receiver != address(0)); uint256 value = print.value; delete pendingPrintMap[_lockId]; uint256 supply = erc20Store.totalSupply(); uint256 newSupply = supply + value; if (newSupply >= supply) { erc20Store.setTotalSupply(newSupply); erc20Store.addBalance(receiver, value); emit PrintingConfirmed(_lockId, receiver, value); erc20Proxy.emitTransfer(address(0), receiver, value); } } /** @notice Burns the specified value from the sender's balance. * * @dev Sender's balanced is subtracted by the amount they wish to burn. * * @param _value The amount to burn. * * @return success true if the burn succeeded. */ function burn(uint256 _value) public returns (bool success) { require(blocked[msg.sender] != true); uint256 balanceOfSender = erc20Store.balances(msg.sender); require(_value <= balanceOfSender); erc20Store.setBalance(msg.sender, balanceOfSender - _value); erc20Store.setTotalSupply(erc20Store.totalSupply() - _value); erc20Proxy.emitTransfer(msg.sender, address(0), _value); return true; } /** @notice Burns the specified value from the balance in question. * * @dev Suspected balance is subtracted by the amount which will be burnt. * * @dev If suspected balance has less than the amount requested, it will be set to 0. * * @param _from The address of suspected balance. * * @param _value The amount to burn. * * @return success true if the burn succeeded. */ function burn(address _from, uint256 _value) public onlyCustodian returns (bool success) { uint256 balance = erc20Store.balances(_from); if(_value <= balance){ erc20Store.setBalance(_from, balance - _value); erc20Store.setTotalSupply(erc20Store.totalSupply() - _value); erc20Proxy.emitTransfer(_from, address(0), _value); emit Wiped(_from, _value, 0); } else { erc20Store.setBalance(_from,0); erc20Store.setTotalSupply(erc20Store.totalSupply() - balance); erc20Proxy.emitTransfer(_from, address(0), balance); emit Wiped(_from, balance, _value - balance); } return true; } /** @notice A function for a sender to issue multiple transfers to multiple * different addresses at once. This function is implemented for gas * considerations when someone wishes to transfer, as one transaction is * cheaper than issuing several distinct individual `transfer` transactions. * * @dev By specifying a set of destination addresses and values, the * sender can issue one transaction to transfer multiple amounts to * distinct addresses, rather than issuing each as a separate * transaction. The `_tos` and `_values` arrays must be equal length, and * an index in one array corresponds to the same index in the other array * (e.g. `_tos[0]` will receive `_values[0]`, `_tos[1]` will receive * `_values[1]`, and so on.) * NOTE: transfers to the zero address are disallowed. * * @param _tos The destination addresses to receive the transfers. * @param _values The values for each destination address. * @return success If transfers succeeded. */ function batchTransfer(address[] memory _tos, uint256[] memory _values) public returns (bool success) { require(_tos.length == _values.length); require(blocked[msg.sender] != true); uint256 numTransfers = _tos.length; uint256 senderBalance = erc20Store.balances(msg.sender); for (uint256 i = 0; i < numTransfers; i++) { address to = _tos[i]; require(to != address(0)); require(blocked[to] != true); uint256 v = _values[i]; require(senderBalance >= v); if (msg.sender != to) { senderBalance -= v; erc20Store.addBalance(to, v); } erc20Proxy.emitTransfer(msg.sender, to, v); } erc20Store.setBalance(msg.sender, senderBalance); return true; } /** @notice Enables the delegation of transfer control for many * accounts to the sweeper account, transferring any balances * as well to the given destination. * * @dev An account delegates transfer control by signing the * value of `sweepMsg`. The sweeper account is the only authorized * caller of this function, so it must relay signatures on behalf * of accounts that delegate transfer control to it. Enabling * delegation is idempotent and permanent. If the account has a * balance at the time of enabling delegation, its balance is * also transfered to the given destination account `_to`. * NOTE: transfers to the zero address are disallowed. * * @param _vs The array of recovery byte components of the ECDSA signatures. * @param _rs The array of 'R' components of the ECDSA signatures. * @param _ss The array of 'S' components of the ECDSA signatures. * @param _to The destination for swept balances. */ function enableSweep(uint8[] memory _vs, bytes32[] memory _rs, bytes32[] memory _ss, address _to) public onlySweeper { require(_to != address(0)); require(blocked[_to] != true); require((_vs.length == _rs.length) && (_vs.length == _ss.length)); uint256 numSignatures = _vs.length; uint256 sweptBalance = 0; for (uint256 i = 0; i < numSignatures; ++i) { address from = ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32",sweepMsg)), _vs[i], _rs[i], _ss[i]); require(blocked[from] != true); // ecrecover returns 0 on malformed input if (from != address(0)) { sweptSet[from] = true; uint256 fromBalance = erc20Store.balances(from); if (fromBalance > 0) { sweptBalance += fromBalance; erc20Store.setBalance(from, 0); erc20Proxy.emitTransfer(from, _to, fromBalance); } } } if (sweptBalance > 0) { erc20Store.addBalance(_to, sweptBalance); } } /** @notice For accounts that have delegated, transfer control * to the sweeper, this function transfers their balances to the given * destination. * * @dev The sweeper account is the only authorized caller of * this function. This function accepts an array of addresses to have their * balances transferred for gas efficiency purposes. * NOTE: any address for an account that has not been previously enabled * will be ignored. * NOTE: transfers to the zero address are disallowed. * * @param _froms The addresses to have their balances swept. * @param _to The destination address of all these transfers. */ function replaySweep(address[] memory _froms, address _to) public onlySweeper { require(_to != address(0)); require(blocked[_to] != true); uint256 lenFroms = _froms.length; uint256 sweptBalance = 0; for (uint256 i = 0; i < lenFroms; ++i) { address from = _froms[i]; require(blocked[from] != true); if (sweptSet[from]) { uint256 fromBalance = erc20Store.balances(from); if (fromBalance > 0) { sweptBalance += fromBalance; erc20Store.setBalance(from, 0); erc20Proxy.emitTransfer(from, _to, fromBalance); } } } if (sweptBalance > 0) { erc20Store.addBalance(_to, sweptBalance); } } /** @notice Core logic of the ERC20 `transferFrom` function. * * @dev This function can only be called by the referenced proxy, * which has a `transferFrom` function. * Every argument passed to that function as well as the original * `msg.sender` gets passed to this function. * NOTE: transfers to the zero address are disallowed. * * @param _sender The address initiating the transfer in proxy. */ function transferFromWithSender( address _sender, address _from, address _to, uint256 _value ) public onlyProxy returns (bool success) { require(_to != address(0)); uint256 balanceOfFrom = erc20Store.balances(_from); require(_value <= balanceOfFrom); uint256 senderAllowance = erc20Store.allowed(_from, _sender); require(_value <= senderAllowance); erc20Store.setBalance(_from, balanceOfFrom - _value); erc20Store.addBalance(_to, _value); erc20Store.setAllowance(_from, _sender, senderAllowance - _value); erc20Proxy.emitTransfer(_from, _to, _value); return true; } /** @notice Core logic of the ERC20 `transfer` function. * * @dev This function can only be called by the referenced proxy, * which has a `transfer` function. * Every argument passed to that function as well as the original * `msg.sender` gets passed to this function. * NOTE: transfers to the zero address are disallowed. * * @param _sender The address initiating the transfer in proxy. */ function transferWithSender( address _sender, address _to, uint256 _value ) public onlyProxy returns (bool success) { require(_to != address(0)); uint256 balanceOfSender = erc20Store.balances(_sender); require(_value <= balanceOfSender); erc20Store.setBalance(_sender, balanceOfSender - _value); erc20Store.addBalance(_to, _value); erc20Proxy.emitTransfer(_sender, _to, _value); return true; } /** @notice Tranfers the specified value from the balance in question. * * @dev Suspected balance is subtracted by the amount which will be transfered. * * @dev If suspected balance has less than the amount requested, it will be set to 0. * * @param _from The address of suspected balance. * * @param _value The amount to burn. * * @return success true if the burn succeeded. */ function transfer( address _from, address _to, uint256 _value ) public onlyCustodian returns (bool success) { require(_to != address(0)); uint256 balanceOfSender = erc20Store.balances(_from); if(_value <= balanceOfSender) { erc20Store.setBalance(_from, balanceOfSender - _value); erc20Store.addBalance(_to, _value); erc20Proxy.emitTransfer(_from, _to, _value); } else { erc20Store.setBalance(_from, 0); erc20Store.addBalance(_to, balanceOfSender); erc20Proxy.emitTransfer(_from, _to, balanceOfSender); } return true; } // METHODS (ERC20 sub interface impl.) /// @notice Core logic of the ERC20 `totalSupply` function. function totalSupply() public view returns (uint256) { return erc20Store.totalSupply(); } /// @notice Core logic of the ERC20 `balanceOf` function. function balanceOf(address _owner) public view returns (uint256 balance) { return erc20Store.balances(_owner); } /// @notice Core logic of the ERC20 `allowance` function. function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return erc20Store.allowed(_owner, _spender); } /// @dev internal use only. function blockWallet(address wallet) public onlyCustodian returns (bool success) { blocked[wallet] = true; return true; } /// @dev internal use only. function unblockWallet(address wallet) public onlyCustodian returns (bool success) { blocked[wallet] = false; return true; } // EVENTS /// @dev Emitted by successful `requestPrint` calls. event PrintingLocked(bytes32 _lockId, address _receiver, uint256 _value); /// @dev Emitted by successful `confirmPrint` calls. event PrintingConfirmed(bytes32 _lockId, address _receiver, uint256 _value); event Wiped(address _from, uint256 _value, uint256 _remainder); /// @dev Emitted by successful `requestPrint` calls. } /** @title A contact to govern hybrid control over increases to the token supply. * * @notice A contract that acts as a custodian of the active token * implementation, and an intermediary between it and the ‘true’ custodian. * It preserves the functionality of direct custodianship as well as granting * limited control of token supply increases to an additional key. * * @dev This contract is a layer of indirection between an instance of * ERC20Impl and a custodian. The functionality of the custodianship over * the token implementation is preserved (printing and custodian changes), * but this contract adds the ability for an additional key * (the 'limited printer') to increase the token supply up to a ceiling, * and this supply ceiling can only be raised by the custodian. * */ contract PrintLimiter is LockRequestable { // TYPES /// @dev The struct type for pending ceiling raises. struct PendingCeilingRaise { uint256 raiseBy; } /// @dev The struct type for pending wipes. struct wipeAddress { uint256 value; address from; } /// @dev The struct type for pending transfers. struct transfer { uint256 value; address from; address to; } // MEMBERS /// @dev The reference to the active token implementation. ERC20Impl public erc20Impl; /// @dev The address of the account or contract that acts as the custodian. Custodian public custodian; /** @dev The sole authorized caller of limited printing. * This account is also authorized to lower the supply ceiling and * wiping suspected accounts or transfer funds from them. */ address public limitedPrinter; /** @dev The maximum that the token supply can be increased to * through use of the limited printing feature. * The difference between the current total supply and the supply * ceiling is what is available to the 'limited printer' account. * The value of the ceiling can only be increased by the custodian. */ uint256 public totalSupplyCeiling; /// @dev The map of lock ids to pending ceiling raises. mapping (bytes32 => PendingCeilingRaise) public pendingRaiseMap; /// @dev The map of lock ids to pending wipes. mapping (bytes32 => wipeAddress[]) public pendingWipeMap; /// @dev The map of lock ids to pending transfers. mapping (bytes32 => transfer) public pendingTransferMap; // CONSTRUCTOR constructor( address _erc20Impl, address _custodian, address _limitedPrinter, uint256 _initialCeiling ) public { erc20Impl = ERC20Impl(_erc20Impl); custodian = Custodian(_custodian); limitedPrinter = _limitedPrinter; totalSupplyCeiling = _initialCeiling; } // MODIFIERS modifier onlyCustodian { require(msg.sender == address(custodian)); _; } modifier onlyLimitedPrinter { require(msg.sender == limitedPrinter); _; } /** @notice Increases the token supply, with the newly created tokens * being added to the balance of the specified account. * * @dev The function checks that the value to print does not * exceed the supply ceiling when added to the current total supply. * NOTE: printing to the zero address is disallowed. * * @param _receiver The receiving address of the print. * @param _value The number of tokens to add to the total supply and the * balance of the receiving address. */ function limitedPrint(address _receiver, uint256 _value) public onlyLimitedPrinter { uint256 totalSupply = erc20Impl.totalSupply(); uint256 newTotalSupply = totalSupply + _value; require(newTotalSupply >= totalSupply); require(newTotalSupply <= totalSupplyCeiling); erc20Impl.confirmPrint(erc20Impl.requestPrint(_receiver, _value)); } /** @notice Requests wipe of suspected accounts. * * @dev Returns a unique lock id associated with the request. * Only linitedPrinter can call this function, and confirming the request is authorized * by the custodian. * * @param _from The array of suspected accounts. * * @param _value array of amounts by which suspected accounts will be wiped. * * @return lockId A unique identifier for this request. */ function requestWipe(address[] memory _from, uint256[] memory _value) public onlyLimitedPrinter returns (bytes32 lockId) { lockId = generateLockId(); uint256 amount = _from.length; for(uint256 i = 0; i < amount; i++) { address from = _from[i]; uint256 value = _value[i]; pendingWipeMap[lockId].push(wipeAddress(value, from)); } emit WipeRequested(lockId); return lockId; } /** @notice Confirms a pending wipe of suspected accounts. * * @dev When called by the custodian with a lock id associated with a * pending wipe, the amount requested is burned from the suspected accounts. * * @param _lockId The identifier of a pending wipe request. */ function confirmWipe(bytes32 _lockId) public onlyCustodian { uint256 amount = pendingWipeMap[_lockId].length; for(uint256 i = 0; i < amount; i++) { wipeAddress memory addr = pendingWipeMap[_lockId][i]; address from = addr.from; uint256 value = addr.value; erc20Impl.burn(from, value); } delete pendingWipeMap[_lockId]; emit WipeCompleted(_lockId); } /** @notice Requests transfer from suspected account. * * @dev Returns a unique lock id associated with the request. * Only linitedPrinter can call this function, and confirming the request is authorized * by the custodian. * * @param _from address of suspected accounts. * * @param _to address of reciever. * * @param _value amount which will be transfered. * * @return lockId A unique identifier for this request. */ function requestTransfer(address _from, address _to, uint256 _value) public onlyLimitedPrinter returns (bytes32 lockId) { lockId = generateLockId(); require (_value != 0); pendingTransferMap[lockId] = transfer(_value, _from, _to); emit TransferRequested(lockId, _from, _to, _value); return lockId; } /** @notice Confirms a pending transfer request. * * @dev When called by the custodian with a lock id associated with a * pending transfer request, the amount requested is tranferred from the suspected account. * * @param _lockId The identifier of a pending transfer request. */ function confirmTransfer(bytes32 _lockId) public onlyCustodian { address from = pendingTransferMap[_lockId].from; address to = pendingTransferMap[_lockId].to; uint256 value = pendingTransferMap[_lockId].value; delete pendingTransferMap[_lockId]; erc20Impl.transfer(from, to, value); emit TransferCompleted(_lockId, from, to, value); } /** @notice Requests an increase to the supply ceiling. * * @dev Returns a unique lock id associated with the request. * Anyone can call this function, but confirming the request is authorized * by the custodian. * * @param _raiseBy The amount by which to raise the ceiling. * * @return lockId A unique identifier for this request. */ function requestCeilingRaise(uint256 _raiseBy) public returns (bytes32 lockId) { require(_raiseBy != 0); lockId = generateLockId(); pendingRaiseMap[lockId] = PendingCeilingRaise({ raiseBy: _raiseBy }); emit CeilingRaiseLocked(lockId, _raiseBy); } /** @notice Confirms a pending increase in the token supply. * * @dev When called by the custodian with a lock id associated with a * pending ceiling increase, the amount requested is added to the * current supply ceiling. * NOTE: this function will not execute any raise that would overflow the * supply ceiling, but it will not revert either. * * @param _lockId The identifier of a pending ceiling raise request. */ function confirmCeilingRaise(bytes32 _lockId) public onlyCustodian { PendingCeilingRaise storage pendingRaise = pendingRaiseMap[_lockId]; // copy locals of references to struct members uint256 raiseBy = pendingRaise.raiseBy; // accounts for a gibberish _lockId require(raiseBy != 0); delete pendingRaiseMap[_lockId]; uint256 newCeiling = totalSupplyCeiling + raiseBy; // overflow check if (newCeiling >= totalSupplyCeiling) { totalSupplyCeiling = newCeiling; emit CeilingRaiseConfirmed(_lockId, raiseBy, newCeiling); } } /** @notice Lowers the supply ceiling, further constraining the bound of * what can be printed by the limited printer. * * @dev The limited printer is the sole authorized caller of this function, * so it is the only account that can elect to lower its limit to increase * the token supply. * * @param _lowerBy The amount by which to lower the supply ceiling. */ function lowerCeiling(uint256 _lowerBy) public onlyLimitedPrinter { uint256 newCeiling = totalSupplyCeiling - _lowerBy; // overflow check require(newCeiling <= totalSupplyCeiling); totalSupplyCeiling = newCeiling; emit CeilingLowered(_lowerBy, newCeiling); } /** @notice Pass-through control of print confirmation, allowing this * contract's custodian to act as the custodian of the associated * active token implementation. * * @dev This contract is the direct custodian of the active token * implementation, but this function allows this contract's custodian * to act as though it were the direct custodian of the active * token implementation. Therefore the custodian retains control of * unlimited printing. * * @param _lockId The identifier of a pending print request in * the associated active token implementation. */ function confirmPrintProxy(bytes32 _lockId) public onlyCustodian { erc20Impl.confirmPrint(_lockId); } /** @notice Pass-through control of custodian change confirmation, * allowing this contract's custodian to act as the custodian of * the associated active token implementation. * * @dev This contract is the direct custodian of the active token * implementation, but this function allows this contract's custodian * to act as though it were the direct custodian of the active * token implementation. Therefore the custodian retains control of * custodian changes. * * @param _lockId The identifier of a pending custodian change request * in the associated active token implementation. */ function confirmCustodianChangeProxy(bytes32 _lockId) public onlyCustodian { erc20Impl.confirmCustodianChange(_lockId); } /** @notice Blocks all transactions with wallet. * * @dev Only signers from custodian are authorised t ocall this function * * @param wallet wallet which will be blocked. */ function blockWallet(address wallet) public { require(custodian.signerSet(msg.sender) == true); erc20Impl.blockWallet(wallet); emit Blocked(wallet); } /** @notice Unblocks all transactions with wallet. * * @dev Only signers from custodian are authorised t ocall this function * * @param wallet wallet which will be unblocked. */ function unblock(address wallet) public { require(custodian.signerSet(msg.sender) == true); erc20Impl.unblockWallet(wallet); emit Unblocked(wallet); } // EVENTS /// @dev Emitted by successful `requestCeilingRaise` calls. event CeilingRaiseLocked(bytes32 _lockId, uint256 _raiseBy); /// @dev Emitted by successful `confirmCeilingRaise` calls. event CeilingRaiseConfirmed(bytes32 _lockId, uint256 _raiseBy, uint256 _newCeiling); /// @dev Emitted by successful `lowerCeiling` calls. event CeilingLowered(uint256 _lowerBy, uint256 _newCeiling); /// @dev Emitted by successful `block` calls. event Blocked(address wallet); /// @dev Emitted by successful `unblock` calls. event Unblocked(address wallet); /// @dev Emitted by successful `requestTransfer` calls. event TransferRequested(bytes32 _lockId, address _from, address _to, uint256 _value); /// @dev Emitted by successful `confirmTransfer` calls. event TransferCompleted(bytes32 _lockId, address _from, address _to, uint256 _value); /// @dev Emitted by successful `requestWipe` calls. event WipeRequested(bytes32 _lockId); /// @dev Emitted by successful `confirmWipe` calls. event WipeCompleted(bytes32 _lockId); }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"_lockId","type":"bytes32"}],"name":"confirmCustodianChangeProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wallet","type":"address"}],"name":"blockWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_lockId","type":"bytes32"}],"name":"confirmCeilingRaise","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"pendingRaiseMap","outputs":[{"name":"raiseBy","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_lowerBy","type":"uint256"}],"name":"lowerCeiling","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_lockId","type":"bytes32"}],"name":"confirmTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"custodian","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"erc20Impl","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"limitedPrinter","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_lockId","type":"bytes32"}],"name":"confirmWipe","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"pendingTransferMap","outputs":[{"name":"value","type":"uint256"},{"name":"from","type":"address"},{"name":"to","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wallet","type":"address"}],"name":"unblock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_lockId","type":"bytes32"}],"name":"confirmPrintProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupplyCeiling","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"requestTransfer","outputs":[{"name":"lockId","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_receiver","type":"address"},{"name":"_value","type":"uint256"}],"name":"limitedPrint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"uint256"}],"name":"pendingWipeMap","outputs":[{"name":"value","type":"uint256"},{"name":"from","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address[]"},{"name":"_value","type":"uint256[]"}],"name":"requestWipe","outputs":[{"name":"lockId","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_raiseBy","type":"uint256"}],"name":"requestCeilingRaise","outputs":[{"name":"lockId","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lockRequestCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_erc20Impl","type":"address"},{"name":"_custodian","type":"address"},{"name":"_limitedPrinter","type":"address"},{"name":"_initialCeiling","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"},{"indexed":false,"name":"_raiseBy","type":"uint256"}],"name":"CeilingRaiseLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"},{"indexed":false,"name":"_raiseBy","type":"uint256"},{"indexed":false,"name":"_newCeiling","type":"uint256"}],"name":"CeilingRaiseConfirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lowerBy","type":"uint256"},{"indexed":false,"name":"_newCeiling","type":"uint256"}],"name":"CeilingLowered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"wallet","type":"address"}],"name":"Blocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"wallet","type":"address"}],"name":"Unblocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"},{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"TransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"},{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"TransferCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"}],"name":"WipeRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_lockId","type":"bytes32"}],"name":"WipeCompleted","type":"event"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806358c15eb9116100ad578063a94c7c6511610071578063a94c7c6514610535578063ad0893a914610583578063c30a148a14610602578063c9bc5dbd14610762578063cb81fecf146107a45761012c565b806358c15eb91461037b57806367b220a5146104235780638cbf41451461046757806395a5123314610495578063a4293ead146104b35761012c565b806336a55b38116100f457806336a55b3814610241578063375b74c31461026f5780633c389cc4146102b957806342569ff3146103035780634b211e8b1461034d5761012c565b8063051d995514610131578063053e89d71461015f57806312460fdd146101a3578063264da19e146101d15780633351373914610213575b600080fd5b61015d6004803603602081101561014757600080fd5b81019080803590602001909291905050506107c2565b005b6101a16004803603602081101561017557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ac565b005b6101cf600480360360208110156101b957600080fd5b8101908080359060200190929190505050610ad9565b005b6101fd600480360360208110156101e757600080fd5b8101908080359060200190929190505050610be6565b6040518082815260200191505060405180910390f35b61023f6004803603602081101561022957600080fd5b8101908080359060200190929190505050610c04565b005b61026d6004803603602081101561025757600080fd5b8101908080359060200190929190505050610cc0565b005b610277610fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102c1611003565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61030b611029565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103796004803603602081101561036357600080fd5b810190808035906020019092919050505061104f565b005b6103a76004803603602081101561039157600080fd5b81019080803590602001909291905050506112d5565b604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b6104656004803603602081101561043957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061133f565b005b6104936004803603602081101561047d57600080fd5b810190808035906020019092919050505061156c565b005b61049d611656565b6040518082815260200191505060405180910390f35b61051f600480360360608110156104c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061165c565b6040518082815260200191505060405180910390f35b6105816004803603604081101561054b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611876565b005b6105b96004803603604081101561059957600080fd5b810190808035906020019092919080359060200190929190505050611b10565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61074c6004803603604081101561061857600080fd5b810190808035906020019064010000000081111561063557600080fd5b82018360208201111561064757600080fd5b8035906020019184602083028401116401000000008311171561066957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460208302840111640100000000831117156106fd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611b6e565b6040518082815260200191505060405180910390f35b61078e6004803603602081101561077857600080fd5b8101908080359060200190929190505050611d26565b6040518082815260200191505060405180910390f35b6107ac611db2565b6040518082815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081c57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a8343ee826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561089157600080fd5b505af11580156108a5573d6000803e3d6000fd5b5050505050565b60011515600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d972d41336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561094f57600080fd5b505afa158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b810190808051906020019092919050505015151461099657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663053e89d7826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d6020811015610a6157600080fd5b8101908080519060200190929190505050507f75e91ce73c1d3352d8dd3610443539cd33dfe13b1de8f8caae54ec26dd0dc9cb81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b3357600080fd5b60006005600083815260200190815260200160002090506000816000015490506000811415610b6157600080fd5b6005600084815260200190815260200160002060008082016000905550506000816004540190506004548110610be057806004819055507f3779579f908c94480802e9c026789736b5c6a0382577c15f94feb7e23eafcfd284838360405180848152602001838152602001828152602001935050505060405180910390a15b50505050565b60056020528060005260406000206000915090508060000154905081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c5e57600080fd5b600081600454039050600454811115610c7657600080fd5b806004819055507f76f283ae36a7f1bcca5e9475a544804430c59279a8b72325d56fb5ade52ab6328282604051808381526020018281526020019250505060405180910390a15050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d1a57600080fd5b60006007600083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060006007600084815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060076000858152602001908152602001600020600001549050600760008581526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663beabacc88484846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610ef457600080fd5b505af1158015610f08573d6000803e3d6000fd5b505050506040513d6020811015610f1e57600080fd5b8101908080519060200190929190505050507fc9fca47377be101830420679b065fa8d4babf6d00e9e9f3ca9957e9e1702fcfb84848484604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a150505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110a957600080fd5b60006006600083815260200190815260200160002080549050905060008090505b8181101561127a576110da611e36565b6006600085815260200190815260200160002082815481106110f857fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050600081602001519050600082600001519050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b505050506040513d602081101561125857600080fd5b81019080805190602001909291905050505050505080806001019150506110ca565b5060066000838152602001908152602001600020600061129a9190611e66565b7fcfeb351cb8d05a7926cfe77b22e781de0de1f7cd7ecc560aad74eec3bb89c05e826040518082815260200191505060405180910390a15050565b60076020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b60011515600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d972d41336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156113e257600080fd5b505afa1580156113f6573d6000803e3d6000fd5b505050506040513d602081101561140c57600080fd5b810190808051906020019092919050505015151461142957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631c8e1179826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156114ca57600080fd5b505af11580156114de573d6000803e3d6000fd5b505050506040513d60208110156114f457600080fd5b8101908080519060200190929190505050507f5c272fb29e21b46870af1850afe89126704c55a7781cc100da3f733e15446c7d81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115c657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663380ba30c826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561163b57600080fd5b505af115801561164f573d6000803e3d6000fd5b5050505050565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b857600080fd5b6116c0611db8565b905060008214156116d057600080fd5b60405180606001604052808381526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815250600760008381526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507f9faa753ed5a2641472b023d1b566564ce497a631d59025ab5e229f5555f53da981858585604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a18090509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118d057600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561193a57600080fd5b505afa15801561194e573d6000803e3d6000fd5b505050506040513d602081101561196457600080fd5b81019080805190602001909291905050509050600082820190508181101561198b57600080fd5b60045481111561199a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663380ba30c600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663be23d29187876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a8157600080fd5b505af1158015611a95573d6000803e3d6000fd5b505050506040513d6020811015611aab57600080fd5b81019080805190602001909291905050506040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611af257600080fd5b505af1158015611b06573d6000803e3d6000fd5b5050505050505050565b60066020528160005260406000208181548110611b2957fe5b9060005260206000209060020201600091509150508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bca57600080fd5b611bd2611db8565b905060008351905060008090505b81811015611ce4576000858281518110611bf657fe5b602002602001015190506000858381518110611c0e57fe5b602002602001015190506006600086815260200190815260200160002060405180604001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff16815250908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050508080600101915050611be0565b507f2e36110f55c44d46767d3114374b581cb0b4e788902a209bd542d56e85d28385826040518082815260200191505060405180910390a18191505092915050565b600080821415611d3557600080fd5b611d3d611db8565b905060405180602001604052808381525060056000838152602001908152602001600020600082015181600001559050507f938f54351a24c466787f903e29b0590fe701da10a63db9b78c2a10ad8a8e1f678183604051808381526020018281526020019250505060405180910390a1919050565b60005481565b60006001430340306000808154600101919050819055604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001935050505060405160208183030381529060405280519060200120905090565b604051806040016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b5080546000825560020290600052602060002090810190611e879190611e8a565b50565b611ed591905b80821115611ed1576000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600201611e90565b5090565b9056fea265627a7a72305820fe84821aafea4abef06f77a7de5ce773255cb3c427f82d03457d0ffff0a7107864736f6c634300050a0032
Deployed Bytecode Sourcemap
55362:12839:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;55362:12839:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66111:135;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66111:135:0;;;;;;;;;;;;;;;;;:::i;:::-;;66470:182;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66470:182:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;63247:649;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;63247:649:0;;;;;;;;;;;;;;;;;:::i;:::-;;56773:63;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;56773:63:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;64331:310;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;64331:310:0;;;;;;;;;;;;;;;;;:::i;:::-;;61618:399;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;61618:399:0;;;;;;;;;;;;;;;;;:::i;:::-;;56035:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;55918;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;56280:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;59939:455;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;59939:455:0;;;;;;;;;;;;;;;;;:::i;:::-;;57020:55;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;57020:55:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66879:182;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66879:182:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;65308:115;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;65308:115:0;;;;;;;;;;;;;;;;;:::i;:::-;;56669:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;60927:353;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;60927:353:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;58243:386;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;58243:386:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;56898:56;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;56898:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59134:476;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;59134:476:0;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;59134:476:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;59134:476:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;59134:476:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;59134:476:0;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;59134:476:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;59134:476:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;59134:476:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;59134:476:0;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;62434:315;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;62434:315:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;573:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;66111:135;57546:9;;;;;;;;;;;57524:32;;:10;:32;;;57516:41;;;;;;66197:9;;;;;;;;;;;:32;;;66230:7;66197:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66197:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;66197:41:0;;;;66111:135;:::o;66470:182::-;66568:4;66533:39;;:9;;;;;;;;;;;:19;;;66553:10;66533:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66533:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;66533:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66533:31:0;;;;;;;;;;;;;;;;:39;;;66525:48;;;;;;66584:9;;;;;;;;;;;:21;;;66606:6;66584:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66584:29:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;66584:29:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66584:29:0;;;;;;;;;;;;;;;;;66629:15;66637:6;66629:15;;;;;;;;;;;;;;;;;;;;;;66470:182;:::o;63247:649::-;57546:9;;;;;;;;;;;57524:32;;:10;:32;;;57516:41;;;;;;63325:40;63368:15;:24;63384:7;63368:24;;;;;;;;;;;63325:67;;63461:15;63479:12;:20;;;63461:38;;63574:1;63563:7;:12;;63555:21;;;;;;63596:15;:24;63612:7;63596:24;;;;;;;;;;;;63589:31;;;;;;;;63633:18;63675:7;63654:18;;:28;63633:49;;63738:18;;63724:10;:32;63720:169;;63794:10;63773:18;:31;;;;63826:51;63848:7;63857;63866:10;63826:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;63720:169;57568:1;;;63247:649;:::o;56773:63::-;;;;;;;;;;;;;;;;;;;;;;:::o;64331:310::-;57644:14;;;;;;;;;;;57630:28;;:10;:28;;;57622:37;;;;;;64408:18;64450:8;64429:18;;:29;64408:50;;64518:18;;64504:10;:32;;64496:41;;;;;;64569:10;64548:18;:31;;;;64597:36;64612:8;64622:10;64597:36;;;;;;;;;;;;;;;;;;;;;;;;57670:1;64331:310;:::o;61618:399::-;57546:9;;;;;;;;;;;57524:32;;:10;:32;;;57516:41;;;;;;61692:12;61707:18;:27;61726:7;61707:27;;;;;;;;;;;:32;;;;;;;;;;;;61692:47;;61750:10;61763:18;:27;61782:7;61763:27;;;;;;;;;;;:30;;;;;;;;;;;;61750:43;;61804:13;61820:18;:27;61839:7;61820:27;;;;;;;;;;;:33;;;61804:49;;61873:18;:27;61892:7;61873:27;;;;;;;;;;;;61866:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61913:9;;;;;;;;;;;:18;;;61932:4;61938:2;61942:5;61913:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;61913:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;61913:35:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;61913:35:0;;;;;;;;;;;;;;;;;61966:43;61984:7;61993:4;61999:2;62003:5;61966:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57568:1;;;61618:399;:::o;56035:26::-;;;;;;;;;;;;;:::o;55918:::-;;;;;;;;;;;;;:::o;56280:29::-;;;;;;;;;;;;;:::o;59939:455::-;57546:9;;;;;;;;;;;57524:32;;:10;:32;;;57516:41;;;;;;60009:14;60026;:23;60041:7;60026:23;;;;;;;;;;;:30;;;;60009:47;;60071:9;60083:1;60071:13;;60067:237;60090:6;60086:1;:10;60067:237;;;60118:23;;:::i;:::-;60144:14;:23;60159:7;60144:23;;;;;;;;;;;60168:1;60144:26;;;;;;;;;;;;;;;;;;60118:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60185:12;60200:4;:9;;;60185:24;;60224:13;60240:4;:10;;;60224:26;;60265:9;;;;;;;;;;;:14;;;60280:4;60286:5;60265:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60265:27:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;60265:27:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;60265:27:0;;;;;;;;;;;;;;;;;60067:237;;;60098:3;;;;;;;60067:237;;;;60323:14;:23;60338:7;60323:23;;;;;;;;;;;;60316:30;;;;:::i;:::-;60364:22;60378:7;60364:22;;;;;;;;;;;;;;;;;;57568:1;59939:455;:::o;57020:55::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;66879:182::-;66973:4;66938:39;;:9;;;;;;;;;;;:19;;;66958:10;66938:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66938:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;66938:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66938:31:0;;;;;;;;;;;;;;;;:39;;;66930:48;;;;;;66989:9;;;;;;;;;;;:23;;;67013:6;66989:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66989:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;66989:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;66989:31:0;;;;;;;;;;;;;;;;;67036:17;67046:6;67036:17;;;;;;;;;;;;;;;;;;;;;;66879:182;:::o;65308:115::-;57546:9;;;;;;;;;;;57524:32;;:10;:32;;;57516:41;;;;;;65384:9;;;;;;;;;;;:22;;;65407:7;65384:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;65384:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;65384:31:0;;;;65308:115;:::o;56669:33::-;;;;:::o;60927:353::-;61031:14;57644;;;;;;;;;;;57630:28;;:10;:28;;;57622:37;;;;;;61067:16;:14;:16::i;:::-;61058:25;;61113:1;61103:6;:11;;61094:21;;;;;;61155:28;;;;;;;;61164:6;61155:28;;;;61172:5;61155:28;;;;;;61179:3;61155:28;;;;;61126:18;:26;61145:6;61126:26;;;;;;;;;;;:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61201:45;61219:6;61227:5;61234:3;61239:6;61201:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61266:6;61259:13;;60927:353;;;;;:::o;58243:386::-;57644:14;;;;;;;;;;;57630:28;;:10;:28;;;57622:37;;;;;;58337:19;58359:9;;;;;;;;;;;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;58359:23:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;58359:23:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;58359:23:0;;;;;;;;;;;;;;;;58337:45;;58393:22;58432:6;58418:11;:20;58393:45;;58477:11;58459:14;:29;;58451:38;;;;;;58526:18;;58508:14;:36;;58500:45;;;;;;58556:9;;;;;;;;;;;:22;;;58579:9;;;;;;;;;;;:22;;;58602:9;58613:6;58579:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;58579:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;58579:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;58579:41:0;;;;;;;;;;;;;;;;58556:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;58556:65:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;58556:65:0;;;;57670:1;;58243:386;;:::o;56898:56::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;59134:476::-;59239:14;57644;;;;;;;;;;;57630:28;;:10;:28;;;57622:37;;;;;;59275:16;:14;:16::i;:::-;59266:25;;59302:14;59319:5;:12;59302:29;;59348:9;59360:1;59348:13;;59344:194;59367:6;59363:1;:10;59344:194;;;59395:12;59410:5;59416:1;59410:8;;;;;;;;;;;;;;59395:23;;59433:13;59449:6;59456:1;59449:9;;;;;;;;;;;;;;59433:25;;59473:14;:22;59488:6;59473:22;;;;;;;;;;;59501:24;;;;;;;;59513:5;59501:24;;;;59520:4;59501:24;;;;;59473:53;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;59473:53:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59344:194;;59375:3;;;;;;;59344:194;;;;59555:21;59569:6;59555:21;;;;;;;;;;;;;;;;;;59596:6;59589:13;;;59134:476;;;;:::o;62434:315::-;62497:14;62544:1;62532:8;:13;;62524:22;;;;;;62568:16;:14;:16::i;:::-;62559:25;;62623:64;;;;;;;;62667:8;62623:64;;;62597:15;:23;62613:6;62597:23;;;;;;;;;;;:90;;;;;;;;;;;62705:36;62724:6;62732:8;62705:36;;;;;;;;;;;;;;;;;;;;;;;;62434:315;;;:::o;573:31::-;;;;:::o;1200:177::-;1244:14;1330:1;1315:12;:16;1305:27;1342:4;1351:16;;1349:18;;;;;;;;;;1288:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1288:80:0;;;1278:91;;;;;;1271:98;;1200:177;:::o;55362:12839::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o
Swarm Source
bzzr://fe84821aafea4abef06f77a7de5ce773255cb3c427f82d03457d0ffff0a71078
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 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.