Contract
0x5312f4968901Ec9d4fc43d2b0e437041614B14A2
1
Contract Overview
Balance:
0 Ether
Token:
More Info
My Name Tag:
Not Available
TokenTracker:
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Dev
Compiler Version
v0.5.17+commit.d19bba13
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-07-17 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: @openzeppelin/contracts/token/ERC20/ERC20Detailed.sol pragma solidity ^0.5.0; /** * @dev Optional functions from the ERC20 standard. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor( string memory name, string memory symbol, uint8 decimals ) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } } // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File: @openzeppelin/contracts/token/ERC20/ERC20.sol pragma solidity ^0.5.0; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue) ); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub( subtractedValue, "ERC20: decreased allowance below zero" ) ); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub( amount, "ERC20: transfer amount exceeds balance" ); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub( amount, "ERC20: burn amount exceeds balance" ); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve( account, _msgSender(), _allowances[account][_msgSender()].sub( amount, "ERC20: burn amount exceeds allowance" ) ); } } // File: @openzeppelin/contracts/access/Roles.sol pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping(address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } /** * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } /** * @dev Check if an account has this role. * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } // File: @openzeppelin/contracts/access/roles/MinterRole.sol pragma solidity ^0.5.0; contract MinterRole is Context { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor() internal { _addMinter(_msgSender()); } modifier onlyMinter() { require( isMinter(_msgSender()), "MinterRole: caller does not have the Minter role" ); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(_msgSender()); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } // File: @openzeppelin/contracts/token/ERC20/ERC20Mintable.sol pragma solidity ^0.5.0; /** * @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole}, * which have permission to mint (create) new tokens as they see fit. * * At construction, the deployer of the contract is the only minter. */ contract ERC20Mintable is ERC20, MinterRole { /** * @dev See {ERC20-_mint}. * * Requirements: * * - the caller must have the {MinterRole}. */ function mint(address account, uint256 amount) public onlyMinter returns (bool) { _mint(account, amount); return true; } } // File: @openzeppelin/contracts/token/ERC20/ERC20Burnable.sol pragma solidity ^0.5.0; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public { _burn(_msgSender(), amount); } /** * @dev See {ERC20-_burnFrom}. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } // File: contracts/src/common/interface/IGroup.sol pragma solidity ^0.5.0; contract IGroup { function isGroup(address _addr) public view returns (bool); function addGroup(address _addr) external; function getGroupKey(address _addr) internal pure returns (bytes32) { return keccak256(abi.encodePacked("_group", _addr)); } } // File: contracts/src/common/validate/AddressValidator.sol pragma solidity ^0.5.0; contract AddressValidator { string constant errorMessage = "this is illegal address"; function validateIllegalAddress(address _addr) external pure { require(_addr != address(0), errorMessage); } function validateGroup(address _addr, address _groupAddr) external view { require(IGroup(_groupAddr).isGroup(_addr), errorMessage); } function validateGroups( address _addr, address _groupAddr1, address _groupAddr2 ) external view { if (IGroup(_groupAddr1).isGroup(_addr)) { return; } require(IGroup(_groupAddr2).isGroup(_addr), errorMessage); } function validateAddress(address _addr, address _target) external pure { require(_addr == _target, errorMessage); } function validateAddresses( address _addr, address _target1, address _target2 ) external pure { if (_addr == _target1) { return; } require(_addr == _target2, errorMessage); } function validate3Addresses( address _addr, address _target1, address _target2, address _target3 ) external pure { if (_addr == _target1) { return; } if (_addr == _target2) { return; } require(_addr == _target3, errorMessage); } } // File: contracts/src/common/validate/UsingValidator.sol pragma solidity ^0.5.0; // prettier-ignore contract UsingValidator { AddressValidator private _validator; constructor() public { _validator = new AddressValidator(); } function addressValidator() internal view returns (AddressValidator) { return _validator; } } // File: contracts/src/common/lifecycle/Killable.sol pragma solidity ^0.5.0; contract Killable { address payable public _owner; constructor() internal { _owner = msg.sender; } function kill() public { require(msg.sender == _owner, "only owner method"); selfdestruct(_owner); } } // File: @openzeppelin/contracts/ownership/Ownable.sol pragma solidity ^0.5.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File: contracts/src/common/config/AddressConfig.sol pragma solidity ^0.5.0; contract AddressConfig is Ownable, UsingValidator, Killable { address public token = 0x98626E2C9231f03504273d55f397409deFD4a093; address public allocator; address public allocatorStorage; address public withdraw; address public withdrawStorage; address public marketFactory; address public marketGroup; address public propertyFactory; address public propertyGroup; address public metricsGroup; address public metricsFactory; address public policy; address public policyFactory; address public policySet; address public policyGroup; address public lockup; address public lockupStorage; address public voteTimes; address public voteTimesStorage; address public voteCounter; address public voteCounterStorage; function setAllocator(address _addr) external onlyOwner { allocator = _addr; } function setAllocatorStorage(address _addr) external onlyOwner { allocatorStorage = _addr; } function setWithdraw(address _addr) external onlyOwner { withdraw = _addr; } function setWithdrawStorage(address _addr) external onlyOwner { withdrawStorage = _addr; } function setMarketFactory(address _addr) external onlyOwner { marketFactory = _addr; } function setMarketGroup(address _addr) external onlyOwner { marketGroup = _addr; } function setPropertyFactory(address _addr) external onlyOwner { propertyFactory = _addr; } function setPropertyGroup(address _addr) external onlyOwner { propertyGroup = _addr; } function setMetricsFactory(address _addr) external onlyOwner { metricsFactory = _addr; } function setMetricsGroup(address _addr) external onlyOwner { metricsGroup = _addr; } function setPolicyFactory(address _addr) external onlyOwner { policyFactory = _addr; } function setPolicyGroup(address _addr) external onlyOwner { policyGroup = _addr; } function setPolicySet(address _addr) external onlyOwner { policySet = _addr; } function setPolicy(address _addr) external { addressValidator().validateAddress(msg.sender, policyFactory); policy = _addr; } function setToken(address _addr) external onlyOwner { token = _addr; } function setLockup(address _addr) external onlyOwner { lockup = _addr; } function setLockupStorage(address _addr) external onlyOwner { lockupStorage = _addr; } function setVoteTimes(address _addr) external onlyOwner { voteTimes = _addr; } function setVoteTimesStorage(address _addr) external onlyOwner { voteTimesStorage = _addr; } function setVoteCounter(address _addr) external onlyOwner { voteCounter = _addr; } function setVoteCounterStorage(address _addr) external onlyOwner { voteCounterStorage = _addr; } } // File: contracts/src/common/config/UsingConfig.sol pragma solidity ^0.5.0; contract UsingConfig { AddressConfig private _config; constructor(address _addressConfig) public { _config = AddressConfig(_addressConfig); } function config() internal view returns (AddressConfig) { return _config; } function configAddress() external view returns (address) { return address(_config); } } // File: contracts/src/common/libs/Decimals.sol pragma solidity ^0.5.0; library Decimals { using SafeMath for uint256; uint120 private constant basisValue = 1000000000000000000; function outOf(uint256 _a, uint256 _b) internal pure returns (uint256 result) { if (_a == 0) { return 0; } uint256 a = _a.mul(basisValue); if (a < _b) { return 0; } return (a.div(_b)); } function mulBasis(uint256 _a) internal pure returns (uint256) { return _a.mul(basisValue); } function divBasis(uint256 _a) internal pure returns (uint256) { return _a.div(basisValue); } } // File: contracts/src/property/IProperty.sol pragma solidity ^0.5.0; contract IProperty { function author() external view returns (address); function withdraw(address _sender, uint256 _value) external; } // File: contracts/src/common/storage/EternalStorage.sol pragma solidity ^0.5.0; contract EternalStorage { address private currentOwner = msg.sender; mapping(bytes32 => uint256) private uIntStorage; mapping(bytes32 => string) private stringStorage; mapping(bytes32 => address) private addressStorage; mapping(bytes32 => bytes32) private bytesStorage; mapping(bytes32 => bool) private boolStorage; mapping(bytes32 => int256) private intStorage; modifier onlyCurrentOwner() { require(msg.sender == currentOwner, "not current owner"); _; } function changeOwner(address _newOwner) external { require(msg.sender == currentOwner, "not current owner"); currentOwner = _newOwner; } // *** Getter Methods *** function getUint(bytes32 _key) external view returns (uint256) { return uIntStorage[_key]; } function getString(bytes32 _key) external view returns (string memory) { return stringStorage[_key]; } function getAddress(bytes32 _key) external view returns (address) { return addressStorage[_key]; } function getBytes(bytes32 _key) external view returns (bytes32) { return bytesStorage[_key]; } function getBool(bytes32 _key) external view returns (bool) { return boolStorage[_key]; } function getInt(bytes32 _key) external view returns (int256) { return intStorage[_key]; } // *** Setter Methods *** function setUint(bytes32 _key, uint256 _value) external onlyCurrentOwner { uIntStorage[_key] = _value; } function setString(bytes32 _key, string calldata _value) external onlyCurrentOwner { stringStorage[_key] = _value; } function setAddress(bytes32 _key, address _value) external onlyCurrentOwner { addressStorage[_key] = _value; } function setBytes(bytes32 _key, bytes32 _value) external onlyCurrentOwner { bytesStorage[_key] = _value; } function setBool(bytes32 _key, bool _value) external onlyCurrentOwner { boolStorage[_key] = _value; } function setInt(bytes32 _key, int256 _value) external onlyCurrentOwner { intStorage[_key] = _value; } // *** Delete Methods *** function deleteUint(bytes32 _key) external onlyCurrentOwner { delete uIntStorage[_key]; } function deleteString(bytes32 _key) external onlyCurrentOwner { delete stringStorage[_key]; } function deleteAddress(bytes32 _key) external onlyCurrentOwner { delete addressStorage[_key]; } function deleteBytes(bytes32 _key) external onlyCurrentOwner { delete bytesStorage[_key]; } function deleteBool(bytes32 _key) external onlyCurrentOwner { delete boolStorage[_key]; } function deleteInt(bytes32 _key) external onlyCurrentOwner { delete intStorage[_key]; } } // File: contracts/src/common/storage/UsingStorage.sol pragma solidity ^0.5.0; contract UsingStorage is Ownable { address private _storage; modifier hasStorage() { require(_storage != address(0), "storage is not setted"); _; } function eternalStorage() internal view hasStorage returns (EternalStorage) { return EternalStorage(_storage); } function getStorageAddress() external view hasStorage returns (address) { return _storage; } function createStorage() external onlyOwner { require(_storage == address(0), "storage is setted"); EternalStorage tmp = new EternalStorage(); _storage = address(tmp); } function setStorage(address _storageAddress) external onlyOwner { _storage = _storageAddress; } function changeOwner(address newOwner) external onlyOwner { EternalStorage(_storage).changeOwner(newOwner); } } // File: contracts/src/lockup/LockupStorage.sol pragma solidity ^0.5.0; contract LockupStorage is UsingStorage { using SafeMath for uint256; uint256 public constant basis = 100000000000000000000000000000000; //Last Block Number function setStorageLastBlockNumber(address _property, uint256 _value) internal { bytes32 key = getStorageLastBlockNumberKey(_property); eternalStorage().setUint(key, _value); } function getStorageLastBlockNumber(address _property) public view returns (uint256) { bytes32 key = getStorageLastBlockNumberKey(_property); return eternalStorage().getUint(key); } function getStorageLastBlockNumberKey(address _property) private pure returns (bytes32) { return keccak256(abi.encodePacked("_lastBlockNumber", _property)); } //AllValue function setStorageAllValue(uint256 _value) internal { bytes32 key = getStorageAllValueKey(); eternalStorage().setUint(key, _value); } function getStorageAllValue() public view returns (uint256) { bytes32 key = getStorageAllValueKey(); return eternalStorage().getUint(key); } function getStorageAllValueKey() private pure returns (bytes32) { return keccak256(abi.encodePacked("_allValue")); } //Value function setStorageValue( address _property, address _sender, uint256 _value ) internal { bytes32 key = getStorageValueKey(_property, _sender); eternalStorage().setUint(key, _value); } function getStorageValue(address _property, address _sender) public view returns (uint256) { bytes32 key = getStorageValueKey(_property, _sender); return eternalStorage().getUint(key); } function getStorageValueKey(address _property, address _sender) private pure returns (bytes32) { return keccak256(abi.encodePacked("_value", _property, _sender)); } //PropertyValue function setStoragePropertyValue(address _property, uint256 _value) internal { bytes32 key = getStoragePropertyValueKey(_property); eternalStorage().setUint(key, _value); } function getStoragePropertyValue(address _property) public view returns (uint256) { bytes32 key = getStoragePropertyValueKey(_property); return eternalStorage().getUint(key); } function getStoragePropertyValueKey(address _property) private pure returns (bytes32) { return keccak256(abi.encodePacked("_propertyValue", _property)); } //WithdrawalStatus function setStorageWithdrawalStatus( address _property, address _from, uint256 _value ) internal { bytes32 key = getStorageWithdrawalStatusKey(_property, _from); eternalStorage().setUint(key, _value); } function getStorageWithdrawalStatus(address _property, address _from) public view returns (uint256) { bytes32 key = getStorageWithdrawalStatusKey(_property, _from); return eternalStorage().getUint(key); } function getStorageWithdrawalStatusKey(address _property, address _sender) private pure returns (bytes32) { return keccak256( abi.encodePacked("_withdrawalStatus", _property, _sender) ); } //InterestPrice function setStorageInterestPrice(address _property, uint256 _value) internal { // The previously used function // This function is only used in testing eternalStorage().setUint(getStorageInterestPriceKey(_property), _value); } function getStorageInterestPrice(address _property) public view returns (uint256) { return eternalStorage().getUint(getStorageInterestPriceKey(_property)); } function getStorageInterestPriceKey(address _property) private pure returns (bytes32) { return keccak256(abi.encodePacked("_interestTotals", _property)); } //LastInterestPrice function setStorageLastInterestPrice( address _property, address _user, uint256 _value ) internal { eternalStorage().setUint( getStorageLastInterestPriceKey(_property, _user), _value ); } function getStorageLastInterestPrice(address _property, address _user) public view returns (uint256) { return eternalStorage().getUint( getStorageLastInterestPriceKey(_property, _user) ); } function getStorageLastInterestPriceKey(address _property, address _user) private pure returns (bytes32) { return keccak256( abi.encodePacked("_lastLastInterestPrice", _property, _user) ); } //LastSameRewardsAmountAndBlock function setStorageLastSameRewardsAmountAndBlock( uint256 _amount, uint256 _block ) internal { uint256 record = _amount.mul(basis).add(_block); eternalStorage().setUint( getStorageLastSameRewardsAmountAndBlockKey(), record ); } function getStorageLastSameRewardsAmountAndBlock() public view returns (uint256 _amount, uint256 _block) { uint256 record = eternalStorage().getUint( getStorageLastSameRewardsAmountAndBlockKey() ); uint256 amount = record.div(basis); uint256 blockNumber = record.sub(amount.mul(basis)); return (amount, blockNumber); } function getStorageLastSameRewardsAmountAndBlockKey() private pure returns (bytes32) { return keccak256(abi.encodePacked("_LastSameRewardsAmountAndBlock")); } //CumulativeGlobalRewards function setStorageCumulativeGlobalRewards(uint256 _value) internal { eternalStorage().setUint( getStorageCumulativeGlobalRewardsKey(), _value ); } function getStorageCumulativeGlobalRewards() public view returns (uint256) { return eternalStorage().getUint(getStorageCumulativeGlobalRewardsKey()); } function getStorageCumulativeGlobalRewardsKey() private pure returns (bytes32) { return keccak256(abi.encodePacked("_cumulativeGlobalRewards")); } //LastCumulativeGlobalReward function setStorageLastCumulativeGlobalReward( address _property, address _user, uint256 _value ) internal { eternalStorage().setUint( getStorageLastCumulativeGlobalRewardKey(_property, _user), _value ); } function getStorageLastCumulativeGlobalReward( address _property, address _user ) public view returns (uint256) { return eternalStorage().getUint( getStorageLastCumulativeGlobalRewardKey(_property, _user) ); } function getStorageLastCumulativeGlobalRewardKey( address _property, address _user ) private pure returns (bytes32) { return keccak256( abi.encodePacked( "_LastCumulativeGlobalReward", _property, _user ) ); } //CumulativeLockedUpUnitAndBlock function setStorageCumulativeLockedUpUnitAndBlock( address _addr, uint256 _unit, uint256 _block ) internal { uint256 record = _unit.mul(basis).add(_block); eternalStorage().setUint( getStorageCumulativeLockedUpUnitAndBlockKey(_addr), record ); } function getStorageCumulativeLockedUpUnitAndBlock(address _addr) public view returns (uint256 _unit, uint256 _block) { uint256 record = eternalStorage().getUint( getStorageCumulativeLockedUpUnitAndBlockKey(_addr) ); uint256 unit = record.div(basis); uint256 blockNumber = record.sub(unit.mul(basis)); return (unit, blockNumber); } function getStorageCumulativeLockedUpUnitAndBlockKey(address _addr) private pure returns (bytes32) { return keccak256( abi.encodePacked("_cumulativeLockedUpUnitAndBlock", _addr) ); } //CumulativeLockedUpValue function setStorageCumulativeLockedUpValue(address _addr, uint256 _value) internal { eternalStorage().setUint( getStorageCumulativeLockedUpValueKey(_addr), _value ); } function getStorageCumulativeLockedUpValue(address _addr) public view returns (uint256) { return eternalStorage().getUint( getStorageCumulativeLockedUpValueKey(_addr) ); } function getStorageCumulativeLockedUpValueKey(address _addr) private pure returns (bytes32) { return keccak256(abi.encodePacked("_cumulativeLockedUpValue", _addr)); } //PendingWithdrawal function setStoragePendingInterestWithdrawal( address _property, address _user, uint256 _value ) internal { eternalStorage().setUint( getStoragePendingInterestWithdrawalKey(_property, _user), _value ); } function getStoragePendingInterestWithdrawal( address _property, address _user ) public view returns (uint256) { return eternalStorage().getUint( getStoragePendingInterestWithdrawalKey(_property, _user) ); } function getStoragePendingInterestWithdrawalKey( address _property, address _user ) private pure returns (bytes32) { return keccak256( abi.encodePacked("_pendingInterestWithdrawal", _property, _user) ); } //DIP4GenesisBlock function setStorageDIP4GenesisBlock(uint256 _block) internal { eternalStorage().setUint(getStorageDIP4GenesisBlockKey(), _block); } function getStorageDIP4GenesisBlock() public view returns (uint256) { return eternalStorage().getUint(getStorageDIP4GenesisBlockKey()); } function getStorageDIP4GenesisBlockKey() private pure returns (bytes32) { return keccak256(abi.encodePacked("_dip4GenesisBlock")); } } // File: contracts/src/policy/IPolicy.sol pragma solidity ^0.5.0; contract IPolicy { function rewards(uint256 _lockups, uint256 _assets) external view returns (uint256); function holdersShare(uint256 _amount, uint256 _lockups) external view returns (uint256); function assetValue(uint256 _value, uint256 _lockups) external view returns (uint256); function authenticationFee(uint256 _assets, uint256 _propertyAssets) external view returns (uint256); function marketApproval(uint256 _agree, uint256 _opposite) external view returns (bool); function policyApproval(uint256 _agree, uint256 _opposite) external view returns (bool); function marketVotingBlocks() external view returns (uint256); function policyVotingBlocks() external view returns (uint256); function abstentionPenalty(uint256 _count) external view returns (uint256); function lockUpBlocks() external view returns (uint256); } // File: contracts/src/allocator/IAllocator.sol pragma solidity ^0.5.0; contract IAllocator { function calculateMaxRewardsPerBlock() public view returns (uint256); function beforeBalanceChange( address _property, address _from, address _to // solium-disable-next-line indentation ) external; } // File: contracts/src/lockup/ILockup.sol pragma solidity ^0.5.0; contract ILockup { function lockup( address _from, address _property, uint256 _value // solium-disable-next-line indentation ) external; function update() public; function cancel(address _property) external; function withdraw(address _property) external; function difference(address _property, uint256 _lastReward) public view returns ( uint256 _reward, uint256 _holdersAmount, uint256 _holdersPrice, uint256 _interestAmount, uint256 _interestPrice ); function next(address _property) public view returns ( uint256 _holders, uint256 _interest, uint256 _holdersPrice, uint256 _interestPrice ); function getPropertyValue(address _property) external view returns (uint256); function getAllValue() external view returns (uint256); function getValue(address _property, address _sender) external view returns (uint256); function calculateWithdrawableInterestAmount( address _property, address _user ) public view returns ( // solium-disable-next-line indentation uint256 ); function withdrawInterest(address _property) external; } // File: contracts/src/lockup/Lockup.sol pragma solidity ^0.5.0; // prettier-ignore contract Lockup is ILockup, UsingConfig, UsingValidator, LockupStorage { using SafeMath for uint256; using Decimals for uint256; event Lockedup(address _from, address _property, uint256 _value); // solium-disable-next-line no-empty-blocks constructor(address _config) public UsingConfig(_config) {} function lockup( address _from, address _property, uint256 _value ) external { addressValidator().validateAddress(msg.sender, config().token()); addressValidator().validateGroup(_property, config().propertyGroup()); require(_value != 0, "illegal lockup value"); bool isWaiting = getStorageWithdrawalStatus(_property, _from) != 0; require(isWaiting == false, "lockup is already canceled"); if (getStorageLastBlockNumber(_property) == 0) { // Set the block that has been locked-up for the first time as the starting block. setStorageLastBlockNumber(_property, block.number); } updatePendingInterestWithdrawal(_property, _from); (, uint256 last) = _calculateWithdrawableInterestAmount( _property, _from ); updateLastPriceForProperty(_property, _from, last); updateValues(true, _from, _property, _value); emit Lockedup(_from, _property, _value); } function cancel(address _property) external { addressValidator().validateGroup(_property, config().propertyGroup()); require(hasValue(_property, msg.sender), "dev token is not locked"); bool isWaiting = getStorageWithdrawalStatus(_property, msg.sender) != 0; require(isWaiting == false, "lockup is already canceled"); uint256 blockNumber = IPolicy(config().policy()).lockUpBlocks(); blockNumber = blockNumber.add(block.number); setStorageWithdrawalStatus(_property, msg.sender, blockNumber); } function withdraw(address _property) external { addressValidator().validateGroup(_property, config().propertyGroup()); require(possible(_property, msg.sender), "waiting for release"); uint256 lockedUpValue = getStorageValue(_property, msg.sender); require(lockedUpValue != 0, "dev token is not locked"); updatePendingInterestWithdrawal(_property, msg.sender); IProperty(_property).withdraw(msg.sender, lockedUpValue); updateValues(false, msg.sender, _property, lockedUpValue); setStorageValue(_property, msg.sender, 0); setStorageWithdrawalStatus(_property, msg.sender, 0); } function getCumulativeLockedUpUnitAndBlock(address _property) private view returns (uint256 _unit, uint256 _block) { ( uint256 unit, uint256 lastBlock ) = getStorageCumulativeLockedUpUnitAndBlock(_property); if (lastBlock > 0) { return (unit, lastBlock); } // When lastBlock is 0, CumulativeLockedUpUnitAndBlock is not saved yet so failback to AllValue or PropertyValue. unit = _property == address(0) ? getStorageAllValue() : getStoragePropertyValue(_property); // Assign lastBlock as DIP4GenesisBlock because when AllValue or PropertyValue is not 0, already locked-up when started DIP4. lastBlock = getStorageDIP4GenesisBlock(); return (unit, lastBlock); } function getCumulativeLockedUp(address _property) public view returns ( uint256 _value, uint256 _unit, uint256 _block ) { (uint256 unit, uint256 lastBlock) = getCumulativeLockedUpUnitAndBlock( _property ); uint256 lastValue = getStorageCumulativeLockedUpValue(_property); return ( lastValue.add(unit.mul(block.number.sub(lastBlock))), unit, lastBlock ); } function getCumulativeLockedUpAll() public view returns ( uint256 _value, uint256 _unit, uint256 _block ) { return getCumulativeLockedUp(address(0)); } function updateCumulativeLockedUp( bool _addition, address _property, uint256 _unit ) private { address zero = address(0); (uint256 lastValue, uint256 lastUnit, ) = getCumulativeLockedUp( _property ); (uint256 lastValueAll, uint256 lastUnitAll, ) = getCumulativeLockedUp( zero ); setStorageCumulativeLockedUpValue( _property, _addition ? lastValue.add(_unit) : lastValue.sub(_unit) ); setStorageCumulativeLockedUpValue( zero, _addition ? lastValueAll.add(_unit) : lastValueAll.sub(_unit) ); setStorageCumulativeLockedUpUnitAndBlock( _property, _addition ? lastUnit.add(_unit) : lastUnit.sub(_unit), block.number ); setStorageCumulativeLockedUpUnitAndBlock( zero, _addition ? lastUnitAll.add(_unit) : lastUnitAll.sub(_unit), block.number ); } function update() public { (uint256 _nextRewards, uint256 _amount) = dry(); setStorageCumulativeGlobalRewards(_nextRewards); setStorageLastSameRewardsAmountAndBlock(_amount, block.number); } function updateLastPriceForProperty( address _property, address _user, uint256 _lastInterest ) private { setStorageLastCumulativeGlobalReward(_property, _user, _lastInterest); setStorageLastBlockNumber(_property, block.number); } function term(address _property) private view returns (uint256 begin, uint256 end) { return (getStorageLastBlockNumber(_property), block.number); } function dry() private view returns (uint256 _nextRewards, uint256 _amount) { uint256 rewardsAmount = IAllocator(config().allocator()) .calculateMaxRewardsPerBlock(); ( uint256 lastAmount, uint256 lastBlock ) = getStorageLastSameRewardsAmountAndBlock(); uint256 lastMaxRewards = lastAmount == rewardsAmount ? rewardsAmount : lastAmount; uint256 blocks = lastBlock > 0 ? block.number.sub(lastBlock) : 0; uint256 additionalRewards = lastMaxRewards.mul(blocks); uint256 nextRewards = getStorageCumulativeGlobalRewards().add( additionalRewards ); return (nextRewards, rewardsAmount); } function difference(address _property, uint256 _lastReward) public view returns ( uint256 _reward, uint256 _holdersAmount, uint256 _holdersPrice, uint256 _interestAmount, uint256 _interestPrice ) { (uint256 rewards, ) = dry(); (uint256 valuePerProperty, , ) = getCumulativeLockedUp(_property); (uint256 valueAll, , ) = getCumulativeLockedUpAll(); uint256 propertyRewards = rewards.sub(_lastReward).mul( valuePerProperty.mulBasis().outOf(valueAll) ); uint256 lockedUpPerProperty = getStoragePropertyValue(_property); uint256 totalSupply = ERC20Mintable(_property).totalSupply(); uint256 holders = IPolicy(config().policy()).holdersShare( propertyRewards, lockedUpPerProperty ); uint256 interest = propertyRewards.sub(holders); return ( rewards, holders, holders.div(totalSupply), interest, lockedUpPerProperty > 0 ? interest.div(lockedUpPerProperty) : 0 ); } function next(address _property) public view returns ( uint256 _holders, uint256 _interest, uint256 _holdersPrice, uint256 _interestPrice ) { (uint256 nextRewards, ) = dry(); (uint256 valuePerProperty, , ) = getCumulativeLockedUp(_property); (uint256 valueAll, , ) = getCumulativeLockedUpAll(); uint256 share = valuePerProperty.mulBasis().outOf(valueAll); uint256 propertyRewards = nextRewards.mul(share); uint256 lockedUp = getStoragePropertyValue(_property); uint256 holders = IPolicy(config().policy()).holdersShare( propertyRewards, lockedUp ); uint256 interest = propertyRewards.sub(holders); uint256 holdersPrice = holders.div( ERC20Mintable(_property).totalSupply() ); uint256 interestPrice = lockedUp > 0 ? interest.div(lockedUp) : 0; return (holders, interest, holdersPrice, interestPrice); } function _calculateInterestAmount(address _property, address _user) private view returns (uint256 _amount, uint256 _interest) { uint256 last = getStorageLastCumulativeGlobalReward(_property, _user); (uint256 nextReward, , , , uint256 price) = difference(_property, last); uint256 lockedUpPerAccount = getStorageValue(_property, _user); uint256 amount = price.mul(lockedUpPerAccount); uint256 result = amount > 0 ? amount.divBasis().divBasis() : 0; return (result, nextReward); } function _calculateWithdrawableInterestAmount( address _property, address _user ) private view returns (uint256 _amount, uint256 _reward) { uint256 pending = getStoragePendingInterestWithdrawal(_property, _user); uint256 legacy = __legacyWithdrawableInterestAmount(_property, _user); (uint256 amount, uint256 reward) = _calculateInterestAmount( _property, _user ); uint256 withdrawableAmount = amount .add(pending) // solium-disable-next-line indentation .add(legacy); return (withdrawableAmount, reward); } function calculateWithdrawableInterestAmount( address _property, address _user ) public view returns (uint256) { (uint256 amount, ) = _calculateWithdrawableInterestAmount( _property, _user ); return amount; } function withdrawInterest(address _property) external { addressValidator().validateGroup(_property, config().propertyGroup()); (uint256 value, uint256 last) = _calculateWithdrawableInterestAmount( _property, msg.sender ); require(value > 0, "your interest amount is 0"); setStoragePendingInterestWithdrawal(_property, msg.sender, 0); ERC20Mintable erc20 = ERC20Mintable(config().token()); updateLastPriceForProperty(_property, msg.sender, last); __updateLegacyWithdrawableInterestAmount(_property, msg.sender); require(erc20.mint(msg.sender, value), "dev mint failed"); update(); } function updateValues( bool _addition, address _account, address _property, uint256 _value ) private { if (_addition) { updateCumulativeLockedUp(true, _property, _value); addAllValue(_value); addPropertyValue(_property, _value); addValue(_property, _account, _value); } else { updateCumulativeLockedUp(false, _property, _value); subAllValue(_value); subPropertyValue(_property, _value); } update(); } function getAllValue() external view returns (uint256) { return getStorageAllValue(); } function addAllValue(uint256 _value) private { uint256 value = getStorageAllValue(); value = value.add(_value); setStorageAllValue(value); } function subAllValue(uint256 _value) private { uint256 value = getStorageAllValue(); value = value.sub(_value); setStorageAllValue(value); } function getValue(address _property, address _sender) external view returns (uint256) { return getStorageValue(_property, _sender); } function addValue( address _property, address _sender, uint256 _value ) private { uint256 value = getStorageValue(_property, _sender); value = value.add(_value); setStorageValue(_property, _sender, value); } function hasValue(address _property, address _sender) private view returns (bool) { uint256 value = getStorageValue(_property, _sender); return value != 0; } function getPropertyValue(address _property) external view returns (uint256) { return getStoragePropertyValue(_property); } function addPropertyValue(address _property, uint256 _value) private { uint256 value = getStoragePropertyValue(_property); value = value.add(_value); setStoragePropertyValue(_property, value); } function subPropertyValue(address _property, uint256 _value) private { uint256 value = getStoragePropertyValue(_property); uint256 nextValue = value.sub(_value); setStoragePropertyValue(_property, nextValue); } function updatePendingInterestWithdrawal(address _property, address _user) private { (uint256 withdrawableAmount, ) = _calculateWithdrawableInterestAmount( _property, _user ); setStoragePendingInterestWithdrawal( _property, _user, withdrawableAmount ); __updateLegacyWithdrawableInterestAmount(_property, _user); } function possible(address _property, address _from) private view returns (bool) { uint256 blockNumber = getStorageWithdrawalStatus(_property, _from); if (blockNumber == 0) { return false; } if (blockNumber <= block.number) { return true; } else { if (IPolicy(config().policy()).lockUpBlocks() == 1) { return true; } } return false; } function __legacyWithdrawableInterestAmount( address _property, address _user ) private view returns (uint256) { uint256 _last = getStorageLastInterestPrice(_property, _user); uint256 price = getStorageInterestPrice(_property); uint256 priceGap = price.sub(_last); uint256 lockedUpValue = getStorageValue(_property, _user); uint256 value = priceGap.mul(lockedUpValue); return value.divBasis(); } function __updateLegacyWithdrawableInterestAmount( address _property, address _user ) private { uint256 interestPrice = getStorageInterestPrice(_property); if (getStorageLastInterestPrice(_property, _user) != interestPrice) { setStorageLastInterestPrice(_property, _user, interestPrice); } } function setDIP4GenesisBlock(uint256 _block) external onlyOwner { setStorageDIP4GenesisBlock(_block); } } // File: contracts/src/dev/Dev.sol pragma solidity ^0.5.0; // prettier-ignore // prettier-ignore // prettier-ignore contract Dev is ERC20Detailed, ERC20Mintable, ERC20Burnable, UsingConfig, UsingValidator { constructor(address _config) public ERC20Detailed("Dev", "DEV", 18) UsingConfig(_config) {} function deposit(address _to, uint256 _amount) external returns (bool) { require(transfer(_to, _amount), "dev transfer failed"); lock(msg.sender, _to, _amount); return true; } function depositFrom( address _from, address _to, uint256 _amount ) external returns (bool) { require(transferFrom(_from, _to, _amount), "dev transferFrom failed"); lock(_from, _to, _amount); return true; } function fee(address _from, uint256 _amount) external returns (bool) { addressValidator().validateGroup(msg.sender, config().marketGroup()); _burn(_from, _amount); return true; } function lock( address _from, address _to, uint256 _amount ) private { Lockup(config().lockup()).lockup(_from, _to, _amount); } }
[{"inputs":[{"internalType":"address","name":"_config","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"configAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001f9538038062001f95833981810160405260208110156200003757600080fd5b50516040805180820182526003808252622232bb60e91b60208381019182528451808601909552918452622222ab60e91b918401919091528151849391601291620000859160009162000290565b5081516200009b90600190602085019062000290565b506002805460ff191660ff9290921691909117905550620000d09050620000c162000143565b6001600160e01b036200014816565b600780546001600160a01b0319166001600160a01b0392909216919091179055604051620000fe9062000315565b604051809103906000f0801580156200011b573d6000803e3d6000fd5b50600880546001600160a01b0319166001600160a01b03929092169190911790555062000340565b335b90565b620001638160066200019a60201b620012001790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b620001af82826001600160e01b036200022716565b1562000202576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216620002705760405162461bcd60e51b815260040180806020018281038252602281526020018062001f736022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620002d357805160ff191683800117855562000303565b8280016001018555821562000303579182015b8281111562000303578251825591602001919060010190620002e6565b506200031192915062000323565b5090565b61072b806200184883390190565b6200014591905b808211156200031157600081556001016200032a565b6114f880620003506000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b85780639e6eda181161007c5780639e6eda18146103c8578063a457c2d7146103f4578063a9059cbb14610420578063aa271e1a1461044c578063d6c3187114610472578063dd62ed3e1461049657610137565b806370a082311461034057806379cc67901461036657806395d89b4114610392578063983b2d561461039a57806398650275146103c057610137565b806339509351116100ff578063395093511461026757806340c10f191461029357806342966c68146102bf57806347e7ef24146102de57806368a9674d1461030a57610137565b806306fdde031461013c578063095ea7b3146101b957806318160ddd146101f957806323b872dd14610213578063313ce56714610249575b600080fd5b6101446104c4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e5600480360360408110156101cf57600080fd5b506001600160a01b03813516906020013561055a565b604080519115158252519081900360200190f35b610201610577565b60408051918252519081900360200190f35b6101e56004803603606081101561022957600080fd5b506001600160a01b0381358116916020810135909116906040013561057d565b61025161060a565b6040805160ff9092168252519081900360200190f35b6101e56004803603604081101561027d57600080fd5b506001600160a01b038135169060200135610613565b6101e5600480360360408110156102a957600080fd5b506001600160a01b038135169060200135610667565b6102dc600480360360208110156102d557600080fd5b50356106be565b005b6101e5600480360360408110156102f457600080fd5b506001600160a01b0381351690602001356106d2565b6101e56004803603606081101561032057600080fd5b506001600160a01b03813581169160208101359091169060400135610730565b6102016004803603602081101561035657600080fd5b50356001600160a01b0316610799565b6102dc6004803603604081101561037c57600080fd5b506001600160a01b0381351690602001356107b4565b6101446107c2565b6102dc600480360360208110156103b057600080fd5b50356001600160a01b0316610822565b6102dc610871565b6101e5600480360360408110156103de57600080fd5b506001600160a01b038135169060200135610883565b6101e56004803603604081101561040a57600080fd5b506001600160a01b038135169060200135610978565b6101e56004803603604081101561043657600080fd5b506001600160a01b0381351690602001356109e6565b6101e56004803603602081101561046257600080fd5b50356001600160a01b03166109fa565b61047a610a13565b604080516001600160a01b039092168252519081900360200190f35b610201600480360360408110156104ac57600080fd5b506001600160a01b0381358116916020013516610a22565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105505780601f1061052557610100808354040283529160200191610550565b820191906000526020600020905b81548152906001019060200180831161053357829003601f168201915b5050505050905090565b600061056e610567610a4d565b8484610a51565b50600192915050565b60055490565b600061058a848484610b3d565b61060084610596610a4d565b6105fb856040518060600160405280602881526020016113c7602891396001600160a01b038a166000908152600460205260408120906105d4610a4d565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610c9b16565b610a51565b5060019392505050565b60025460ff1690565b600061056e610620610a4d565b846105fb8560046000610631610a4d565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610d3216565b6000610679610674610a4d565b6109fa565b6106b45760405162461bcd60e51b81526004018080602001828103825260308152602001806113766030913960400191505060405180910390fd5b61056e8383610d93565b6106cf6106c9610a4d565b82610e85565b50565b60006106de83836109e6565b610725576040805162461bcd60e51b815260206004820152601360248201527219195d881d1c985b9cd9995c8819985a5b1959606a1b604482015290519081900360640190fd5b61056e338484610f81565b600061073d84848461057d565b61078e576040805162461bcd60e51b815260206004820152601760248201527f646576207472616e7366657246726f6d206661696c6564000000000000000000604482015290519081900360640190fd5b610600848484610f81565b6001600160a01b031660009081526003602052604090205490565b6107be8282611064565b5050565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156105505780601f1061052557610100808354040283529160200191610550565b61082d610674610a4d565b6108685760405162461bcd60e51b81526004018080602001828103825260308152602001806113766030913960400191505060405180910390fd5b6106cf816110b8565b61088161087c610a4d565b611100565b565b600061088d611148565b6001600160a01b031663d16ff470336108a4610a13565b6001600160a01b031663fd347d3e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108dc57600080fd5b505afa1580156108f0573d6000803e3d6000fd5b505050506040513d602081101561090657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152516044808301926000929190829003018186803b15801561095657600080fd5b505afa15801561096a573d6000803e3d6000fd5b5050505061056e8383610e85565b600061056e610985610a4d565b846105fb8560405180606001604052806025815260200161149f60259139600460006109af610a4d565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610c9b16565b600061056e6109f3610a4d565b8484610b3d565b6000610a0d60068363ffffffff61115716565b92915050565b6007546001600160a01b031690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610a965760405162461bcd60e51b815260040180806020018281038252602481526020018061147b6024913960400191505060405180910390fd5b6001600160a01b038216610adb5760405162461bcd60e51b815260040180806020018281038252602281526020018061132e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b825760405162461bcd60e51b81526004018080602001828103825260258152602001806114566025913960400191505060405180910390fd5b6001600160a01b038216610bc75760405162461bcd60e51b81526004018080602001828103825260238152602001806112e96023913960400191505060405180910390fd5b610c0a81604051806060016040528060268152602001611350602691396001600160a01b038616600090815260036020526040902054919063ffffffff610c9b16565b6001600160a01b038085166000908152600360205260408082209390935590841681522054610c3f908263ffffffff610d3216565b6001600160a01b0380841660008181526003602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610d2a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610cef578181015183820152602001610cd7565b50505050905090810190601f168015610d1c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610d8c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610dee576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600554610e01908263ffffffff610d3216565b6005556001600160a01b038216600090815260036020526040902054610e2d908263ffffffff610d3216565b6001600160a01b03831660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610eca5760405162461bcd60e51b81526004018080602001828103825260218152602001806114356021913960400191505060405180910390fd5b610f0d8160405180606001604052806022815260200161130c602291396001600160a01b038516600090815260036020526040902054919063ffffffff610c9b16565b6001600160a01b038316600090815260036020526040902055600554610f39908263ffffffff6111be16565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b610f89610a13565b6001600160a01b03166306490f476040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc157600080fd5b505afa158015610fd5573d6000803e3d6000fd5b505050506040513d6020811015610feb57600080fd5b50516040805163e35e8cf160e01b81526001600160a01b0386811660048301528581166024830152604482018590529151919092169163e35e8cf191606480830192600092919082900301818387803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b50505050505050565b61106e8282610e85565b6107be8261107a610a4d565b6105fb84604051806060016040528060248152602001611411602491396001600160a01b0388166000908152600460205260408120906105d4610a4d565b6110c960068263ffffffff61120016565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61111160068263ffffffff61128116565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b6008546001600160a01b031690565b60006001600160a01b03821661119e5760405162461bcd60e51b81526004018080602001828103825260228152602001806113ef6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6000610d8c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c9b565b61120a8282611157565b1561125c576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b61128b8282611157565b6112c65760405162461bcd60e51b81526004018080602001828103825260218152602001806113a66021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820751e5b7ec5025e2c4323fbdd619177ce47f8cfd6140888de7bef51bfd1e4ae4564736f6c63430005110032608060405234801561001057600080fd5b5061070b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80631bde7d8f1461006757806349616d79146100a75780636dd893b9146100d5578063a21929631461010d578063b292b54914610145578063d16ff4701461016b575b600080fd5b6100a56004803603608081101561007d57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516610199565b005b6100a5600480360360408110156100bd57600080fd5b506001600160a01b03813581169160200135166102a1565b6100a5600480360360608110156100eb57600080fd5b506001600160a01b03813581169160208101358216916040909101351661032b565b6100a56004803603606081101561012357600080fd5b506001600160a01b0381358116916020810135821691604090910135166103cf565b6100a56004803603602081101561015b57600080fd5b50356001600160a01b031661054b565b6100a56004803603604081101561018157600080fd5b506001600160a01b03813581169160200135166105c6565b826001600160a01b0316846001600160a01b031614156101b85761029b565b816001600160a01b0316846001600160a01b031614156101d75761029b565b806001600160a01b0316846001600160a01b0316146040518060400160405280601781526020016000805160206106b7833981519152815250906102995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561025e578181015183820152602001610246565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505b50505050565b806001600160a01b0316826001600160a01b0316146040518060400160405280601781526020016000805160206106b7833981519152815250906103265760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561025e578181015183820152602001610246565b505050565b816001600160a01b0316836001600160a01b0316141561034a57610326565b806001600160a01b0316836001600160a01b0316146040518060400160405280601781526020016000805160206106b78339815191528152509061029b5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561025e578181015183820152602001610246565b816001600160a01b0316639e0cc3c4846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561042557600080fd5b505afa158015610439573d6000803e3d6000fd5b505050506040513d602081101561044f57600080fd5b50511561045b57610326565b806001600160a01b0316639e0cc3c4846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156104b157600080fd5b505afa1580156104c5573d6000803e3d6000fd5b505050506040513d60208110156104db57600080fd5b505160408051808201909152601781526000805160206106b783398151915260208201529061029b5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561025e578181015183820152602001610246565b60408051808201909152601781526000805160206106b783398151915260208201526001600160a01b0382166105c25760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561025e578181015183820152602001610246565b5050565b806001600160a01b0316639e0cc3c4836040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561061c57600080fd5b505afa158015610630573d6000803e3d6000fd5b505050506040513d602081101561064657600080fd5b505160408051808201909152601781526000805160206106b78339815191526020820152906103265760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561025e57818101518382015260200161024656fe7468697320697320696c6c6567616c2061646472657373000000000000000000a265627a7a7231582076cf9c4ffbba2ff699687a0d084ff911d578075947f3a9ca536d88c73642726464736f6c63430005110032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373000000000000000000000000d6d07f1c048bdf2b3d5d9b6c25ed1fc5348d0a70
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d6d07f1c048bdf2b3d5d9b6c25ed1fc5348d0a70
-----Decoded View---------------
Arg [0] : _config (address): 0xd6d07f1c048bdf2b3d5d9b6c25ed1fc5348d0a70
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d6d07f1c048bdf2b3d5d9b6c25ed1fc5348d0a70
Deployed ByteCode Sourcemap
59386:975:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;59386:975:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3400:74;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3400:74:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12916:137;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;12916:137:0;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;12043:82;;;:::i;:::-;;;;;;;;;;;;;;;;13486:329;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;13486:329:0;;;;;;;;;;;;;;;;;:::i;4180:74::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14185:220;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;14185:220:0;;;;;;;;:::i;20835:139::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;20835:139:0;;;;;;;;:::i;21426:74::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21426:74:0;;:::i;:::-;;59597:186;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;59597:186:0;;;;;;;;:::i;59788:228::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;59788:228:0;;;;;;;;;;;;;;;;;:::i;12176:101::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12176:101:0;-1:-1:-1;;;;;12176:101:0;;:::i;21550:94::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;21550:94:0;;;;;;;;:::i;3578:78::-;;;:::i;19945:83::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19945:83:0;-1:-1:-1;;;;;19945:83:0;;:::i;20033:70::-;;;:::i;60021:189::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;60021:189:0;;;;;;;;:::i;14863:287::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;14863:287:0;;;;;;;;:::i;12463:143::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;12463:143:0;;;;;;;;:::i;19840:100::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19840:100:0;-1:-1:-1;;;;;19840:100:0;;:::i;29461:90::-;;;:::i;:::-;;;;-1:-1:-1;;;;;29461:90:0;;;;;;;;;;;;;;12657:136;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;12657:136:0;;;;;;;;;;:::i;3400:74::-;3464:5;3457:12;;;;;;;;-1:-1:-1;;3457:12:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3437:13;;3457:12;;3464:5;;3457:12;;3464:5;3457:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3400:74;:::o;12916:137::-;12982:4;12993:39;13002:12;:10;:12::i;:::-;13016:7;13025:6;12993:8;:39::i;:::-;-1:-1:-1;13044:4:0;12916:137;;;;:::o;12043:82::-;12108:12;;12043:82;:::o;13486:329::-;13588:4;13599:36;13609:6;13617:9;13628:6;13599:9;:36::i;:::-;13640:154;13654:6;13666:12;:10;:12::i;:::-;13684:105;13728:6;13684:105;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;13684:19:0;;;;;;:11;:19;;;;;;13704:12;:10;:12::i;:::-;-1:-1:-1;;;;;13684:33:0;;;;;;;;;;;;-1:-1:-1;13684:33:0;;;:105;;:37;:105;:::i;:::-;13640:8;:154::i;:::-;-1:-1:-1;13806:4:0;13486:329;;;;;:::o;4180:74::-;4240:9;;;;4180:74;:::o;14185:220::-;14271:4;14284:100;14298:12;:10;:12::i;:::-;14316:7;14329:50;14368:10;14329:11;:25;14341:12;:10;:12::i;:::-;-1:-1:-1;;;;;14329:25:0;;;;;;;;;;;;;;;;;-1:-1:-1;14329:25:0;;;:34;;;;;;;;;;;:50;:38;:50;:::i;20835:139::-;20918:4;19741:22;19750:12;:10;:12::i;:::-;19741:8;:22::i;:::-;19728:96;;;;-1:-1:-1;;;19728:96:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20931:22;20937:7;20946:6;20931:5;:22::i;21426:74::-;21468:27;21474:12;:10;:12::i;:::-;21488:6;21468:5;:27::i;:::-;21426:74;:::o;59597:186::-;59662:4;59681:22;59690:3;59695:7;59681:8;:22::i;:::-;59673:54;;;;;-1:-1:-1;;;59673:54:0;;;;;;;;;;;;-1:-1:-1;;;59673:54:0;;;;;;;;;;;;;;;59732:30;59737:10;59749:3;59754:7;59732:4;:30::i;59788:228::-;59885:4;59904:33;59917:5;59924:3;59929:7;59904:12;:33::i;:::-;59896:69;;;;;-1:-1:-1;;;59896:69:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;59970:25;59975:5;59982:3;59987:7;59970:4;:25::i;12176:101::-;-1:-1:-1;;;;;12254:18:0;12233:7;12254:18;;;:9;:18;;;;;;;12176:101::o;21550:94::-;21613:26;21623:7;21632:6;21613:9;:26::i;:::-;21550:94;;:::o;3578:78::-;3644:7;3637:14;;;;;;;;-1:-1:-1;;3637:14:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3617:13;;3637:14;;3644:7;;3637:14;;3644:7;3637:14;;;;;;;;;;;;;;;;;;;;;;;;19945:83;19741:22;19750:12;:10;:12::i;19741:22::-;19728:96;;;;-1:-1:-1;;;19728:96:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20004:19;20015:7;20004:10;:19::i;20033:70::-;20071:27;20085:12;:10;:12::i;:::-;20071:13;:27::i;:::-;20033:70::o;60021:189::-;60084:4;60095:18;:16;:18::i;:::-;-1:-1:-1;;;;;60095:32:0;;60128:10;60140:8;:6;:8::i;:::-;-1:-1:-1;;;;;60140:20:0;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60140:22:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;60140:22:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;60140:22:0;60095:68;;;-1:-1:-1;;;;;;60095:68:0;;;;;;;-1:-1:-1;;;;;60095:68:0;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;60095:68:0;;;;;;;;;;;5:2:-1;;;;30:1;27;20:12;5:2;60095:68:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;60095:68:0;;;;60168:21;60174:5;60181:7;60168:5;:21::i;14863:287::-;14954:4;14967:162;14981:12;:10;:12::i;:::-;14999:7;15012:112;15057:15;15012:112;;;;;;;;;;;;;;;;;:11;:25;15024:12;:10;:12::i;:::-;-1:-1:-1;;;;;15012:25:0;;;;;;;;;;;;;;;;;-1:-1:-1;15012:25:0;;;:34;;;;;;;;;;;:112;;:38;:112;:::i;12463:143::-;12532:4;12543:42;12553:12;:10;:12::i;:::-;12567:9;12578:6;12543:9;:42::i;19840:100::-;19896:4;19914:21;:8;19927:7;19914:21;:12;:21;:::i;:::-;19907:28;19840:100;-1:-1:-1;;19840:100:0:o;29461:90::-;29538:7;;-1:-1:-1;;;;;29538:7:0;29461:90;:::o;12657:136::-;-1:-1:-1;;;;;12761:18:0;;;12738:7;12761:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;12657:136::o;5104:89::-;5178:10;5104:89;:::o;17619:324::-;-1:-1:-1;;;;;17720:19:0;;17712:68;;;;-1:-1:-1;;;17712:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;17793:21:0;;17785:68;;;;-1:-1:-1;;;17785:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;17860:18:0;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;17906:32;;;;;;;;;;;;;;;;;17619:324;;;:::o;15595:464::-;-1:-1:-1;;;;;15700:20:0;;15692:70;;;;-1:-1:-1;;;15692:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15775:23:0;;15767:71;;;;-1:-1:-1;;;15767:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15865:84;15892:6;15865:84;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15865:17:0;;;;;;:9;:17;;;;;;;:84;;:21;:84;:::i;:::-;-1:-1:-1;;;;;15845:17:0;;;;;;;:9;:17;;;;;;:104;;;;15977:20;;;;;;;:32;;16002:6;15977:32;:24;:32;:::i;:::-;-1:-1:-1;;;;;15954:20:0;;;;;;;:9;:20;;;;;;;;;:55;;;;16019:35;;;;;;;15954:20;;16019:35;;;;;;;;;;;;;15595:464;;;:::o;7131:184::-;7230:7;7260:12;7252:6;;;;7244:29;;;;-1:-1:-1;;;7244:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;7244:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;7290:5:0;;;7131:184::o;6298:160::-;6356:7;6382:5;;;6400:6;;;;6392:46;;;;;-1:-1:-1;;;6392:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;6452:1;6298:160;-1:-1:-1;;;6298:160:0:o;16310:281::-;-1:-1:-1;;;;;16380:21:0;;16372:65;;;;;-1:-1:-1;;;16372:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;16459:12;;:24;;16476:6;16459:24;:16;:24;:::i;:::-;16444:12;:39;-1:-1:-1;;;;;16509:18:0;;;;;;:9;:18;;;;;;:30;;16532:6;16509:30;:22;:30;:::i;:::-;-1:-1:-1;;;;;16488:18:0;;;;;;:9;:18;;;;;;;;:51;;;;16549:37;;;;;;;16488:18;;;;16549:37;;;;;;;;;;16310:281;;:::o;16887:334::-;-1:-1:-1;;;;;16957:21:0;;16949:67;;;;-1:-1:-1;;;16949:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17044:81;17072:6;17044:81;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;17044:18:0;;;;;;:9;:18;;;;;;;:81;;:22;:81;:::i;:::-;-1:-1:-1;;;;;17023:18:0;;;;;;:9;:18;;;;;:102;17145:12;;:24;;17162:6;17145:24;:16;:24;:::i;:::-;17130:12;:39;17179:37;;;;;;;;17205:1;;-1:-1:-1;;;;;17179:37:0;;;;;;;;;;;;16887:334;;:::o;60215:143::-;60307:8;:6;:8::i;:::-;-1:-1:-1;;;;;60307:15:0;;:17;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60307:17:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;60307:17:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;60307:17:0;60300:53;;;-1:-1:-1;;;60300:53:0;;-1:-1:-1;;;;;60300:53:0;;;;;;;;;;;;;;;;;;;;;;:32;;;;;;;:53;;;;;-1:-1:-1;;60300:53:0;;;;;;;-1:-1:-1;60300:32:0;:53;;;5:2:-1;;;;30:1;27;20:12;5:2;60300:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;60300:53:0;;;;60215:143;;;:::o;18108:250::-;18174:22;18180:7;18189:6;18174:5;:22::i;:::-;18201:152;18215:7;18228:12;:10;:12::i;:::-;18246:102;18291:6;18246:102;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;18246:20:0;;;;;;:11;:20;;;;;;18267:12;:10;:12::i;20108:107::-;20159:21;:8;20172:7;20159:21;:12;:21;:::i;:::-;20190:20;;-1:-1:-1;;;;;20190:20:0;;;;;;;;20108:107;:::o;20220:115::-;20274:24;:8;20290:7;20274:24;:15;:24;:::i;:::-;20308:22;;-1:-1:-1;;;;;20308:22:0;;;;;;;;20220:115;:::o;23538:96::-;23619:10;;-1:-1:-1;;;;;23619:10:0;23538:96;:::o;19146:199::-;19227:4;-1:-1:-1;;;;;19248:21:0;;19240:68;;;;-1:-1:-1;;;19240:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;19320:20:0;:11;:20;;;;;;;;;;;;;;;19146:199::o;6703:127::-;6761:7;6782:43;6786:1;6789;6782:43;;;;;;;;;;;;;;;;;:3;:43::i;18667:163::-;18739:18;18743:4;18749:7;18739:3;:18::i;:::-;18738:19;18730:63;;;;;-1:-1:-1;;;18730:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;18798:20:0;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;18798:27:0;18821:4;18798:27;;;18667:163::o;18898:168::-;18972:18;18976:4;18982:7;18972:3;:18::i;:::-;18964:64;;;;-1:-1:-1;;;18964:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;19033:20:0;19056:5;19033:20;;;;;;;;;;;:28;;-1:-1:-1;;19033:28:0;;;18898:168::o
Swarm Source
bzzr://76cf9c4ffbba2ff699687a0d084ff911d578075947f3a9ca536d88c736427264
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.