Address Details
contract
0x43C964FEa97dA1aE1C07CF24b9d430F537f4DC2a
- Creator
- 0xad5e83–557abf at 0x637eff–55fb50
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 1 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 21,107
- Last Balance Update
- 13714402
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- IMMOCirculatingSupplyConrtact
- Optimization enabled
- true
- Compiler version
- v0.7.5+commit.eb77ed08
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2022-01-01T15:17:11.074023Z
IMMOCirculatingSupply.sol
/** *Submitted for verification at Etherscan.io on 2021-04-14 */ // SPDX-License-Identifier: AGPL-3.0-or-later\ pragma solidity 0.7.5; /** * @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. */ 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. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { 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. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint256 c) { if (a > 3) { c = a; uint256 b = add(div(a, 2), 1); while (b < c) { c = b; b = div(add(div(a, b), b), 2); } } else if (a != 0) { c = 1; } } /* * Expects percentage to be trailed by 00, */ function percentageAmount(uint256 total_, uint8 percentage_) internal pure returns (uint256 percentAmount_) { return div(mul(total_, percentage_), 1000); } /* * Expects percentage to be trailed by 00, */ function substractPercentage(uint256 total_, uint8 percentageToSub_) internal pure returns (uint256 result_) { return sub(total_, div(mul(total_, percentageToSub_), 1000)); } function percentageOfTotal(uint256 part_, uint256 total_) internal pure returns (uint256 percent_) { return div(mul(part_, 100), total_); } /** * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } function quadraticPricing(uint256 payment_, uint256 multiplier_) internal pure returns (uint256) { return sqrrt(mul(multiplier_, payment_)); } function bondingCurve(uint256 supply_, uint256 multiplier_) internal pure returns (uint256) { return mul(multiplier_, supply_); } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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); } contract IMMOCirculatingSupplyConrtact { using SafeMath for uint256; bool public isInitialized; address public IMMO; address public owner; address[] public nonCirculatingIMMOAddresses; constructor(address _owner) { owner = _owner; } function initialize(address _IMMO) external returns (bool) { require(msg.sender == owner, "caller is not owner"); require(isInitialized == false); IMMO = _IMMO; isInitialized = true; return true; } function IMMOCirculatingSupply() external view returns (uint256) { uint256 _totalSupply = IERC20(IMMO).totalSupply(); uint256 _circulatingSupply = _totalSupply.sub(getNonCirculatingIMMO()); return _circulatingSupply; } function getNonCirculatingIMMO() public view returns (uint256) { uint256 _nonCirculatingIMMO; for (uint256 i = 0; i < nonCirculatingIMMOAddresses.length; i = i.add(1)) { _nonCirculatingIMMO = _nonCirculatingIMMO.add( IERC20(IMMO).balanceOf(nonCirculatingIMMOAddresses[i]) ); } return _nonCirculatingIMMO; } function setNonCirculatingIMMOAddresses( address[] calldata _nonCirculatingAddresses ) external returns (bool) { require(msg.sender == owner, "Sender is not owner"); nonCirculatingIMMOAddresses = _nonCirculatingAddresses; return true; } function transferOwnership(address _owner) external returns (bool) { require(msg.sender == owner, "Sender is not owner"); owner = _owner; return true; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"IMMO","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"IMMOCirculatingSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNonCirculatingIMMO","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialize","inputs":[{"type":"address","name":"_IMMO","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isInitialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"nonCirculatingIMMOAddresses","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setNonCirculatingIMMOAddresses","inputs":[{"type":"address[]","name":"_nonCirculatingAddresses","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferOwnership","inputs":[{"type":"address","name":"_owner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b506040516107713803806107718339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b0390921691909117905561070e806100636000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80636355aa24116100665780636355aa241461010f578063856dc88f146101175780638da5cb5b14610187578063c4d66de81461018f578063f2fde38b146101b557610093565b8063025de6cd146100985780633630bcb8146100bc578063392e53cd146100d6578063619f2da5146100f2575b600080fd5b6100a06101db565b604080516001600160a01b039092168252519081900360200190f35b6100c46101ef565b60408051918252519081900360200190f35b6100de610289565b604080519115158252519081900360200190f35b6100a06004803603602081101561010857600080fd5b5035610292565b6100c46102bc565b6100de6004803603602081101561012d57600080fd5b81019060208101813564010000000081111561014857600080fd5b82018360208201111561015a57600080fd5b8035906020019184602083028401116401000000008311171561017c57600080fd5b509092509050610391565b6100a06103ff565b6100de600480360360208110156101a557600080fd5b50356001600160a01b031661040e565b6100de600480360360208110156101cb57600080fd5b50356001600160a01b03166104ab565b60005461010090046001600160a01b031681565b600080600060019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024057600080fd5b505afa158015610254573d6000803e3d6000fd5b505050506040513d602081101561026a57600080fd5b50519050600061028261027b6102bc565b8390610526565b9250505090565b60005460ff1681565b600281815481106102a257600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060005b60025481101561038b57600054600280546103779261010090046001600160a01b0316916370a0823191859081106102f657fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561034457600080fd5b505afa158015610358573d6000803e3d6000fd5b505050506040513d602081101561036e57600080fd5b5051839061056f565b915061038481600161056f565b90506102c2565b50905090565b6001546000906001600160a01b031633146103e9576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b6103f560028484610660565b5060019392505050565b6001546001600160a01b031681565b6001546000906001600160a01b03163314610466576040805162461bcd60e51b815260206004820152601360248201527231b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b60005460ff161561047657600080fd5b506000805460ff196001600160a01b03841661010002610100600160a81b031990921691909117166001908117909155919050565b6001546000906001600160a01b03163314610503576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50600180546001600160a01b0383166001600160a01b0319909116178155919050565b600061056883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506105c9565b9392505050565b600082820183811015610568576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081848411156106585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561061d578181015183820152602001610605565b50505050905090810190601f16801561064a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b8280548282559060005260206000209081019282156106b3579160200282015b828111156106b35781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190610680565b506106bf9291506106c3565b5090565b5b808211156106bf57600081556001016106c456fea264697066735822122022a47644bd277cd57f99928ff048cf58b3b1e961a18e4271801760499869fbfe64736f6c63430007050033000000000000000000000000ad5e83886c9d01801f16cbde849f76a52e557abf
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80636355aa24116100665780636355aa241461010f578063856dc88f146101175780638da5cb5b14610187578063c4d66de81461018f578063f2fde38b146101b557610093565b8063025de6cd146100985780633630bcb8146100bc578063392e53cd146100d6578063619f2da5146100f2575b600080fd5b6100a06101db565b604080516001600160a01b039092168252519081900360200190f35b6100c46101ef565b60408051918252519081900360200190f35b6100de610289565b604080519115158252519081900360200190f35b6100a06004803603602081101561010857600080fd5b5035610292565b6100c46102bc565b6100de6004803603602081101561012d57600080fd5b81019060208101813564010000000081111561014857600080fd5b82018360208201111561015a57600080fd5b8035906020019184602083028401116401000000008311171561017c57600080fd5b509092509050610391565b6100a06103ff565b6100de600480360360208110156101a557600080fd5b50356001600160a01b031661040e565b6100de600480360360208110156101cb57600080fd5b50356001600160a01b03166104ab565b60005461010090046001600160a01b031681565b600080600060019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024057600080fd5b505afa158015610254573d6000803e3d6000fd5b505050506040513d602081101561026a57600080fd5b50519050600061028261027b6102bc565b8390610526565b9250505090565b60005460ff1681565b600281815481106102a257600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060005b60025481101561038b57600054600280546103779261010090046001600160a01b0316916370a0823191859081106102f657fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561034457600080fd5b505afa158015610358573d6000803e3d6000fd5b505050506040513d602081101561036e57600080fd5b5051839061056f565b915061038481600161056f565b90506102c2565b50905090565b6001546000906001600160a01b031633146103e9576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b6103f560028484610660565b5060019392505050565b6001546001600160a01b031681565b6001546000906001600160a01b03163314610466576040805162461bcd60e51b815260206004820152601360248201527231b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b60005460ff161561047657600080fd5b506000805460ff196001600160a01b03841661010002610100600160a81b031990921691909117166001908117909155919050565b6001546000906001600160a01b03163314610503576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50600180546001600160a01b0383166001600160a01b0319909116178155919050565b600061056883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506105c9565b9392505050565b600082820183811015610568576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081848411156106585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561061d578181015183820152602001610605565b50505050905090810190601f16801561064a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b8280548282559060005260206000209081019282156106b3579160200282015b828111156106b35781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190610680565b506106bf9291506106c3565b5090565b5b808211156106bf57600081556001016106c456fea264697066735822122022a47644bd277cd57f99928ff048cf58b3b1e961a18e4271801760499869fbfe64736f6c63430007050033