ERC-721
Overview
Max Total Supply
0 MCBR
Holders
6
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
3 MCBRLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Macabris
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import './Governed.sol'; import './Bank.sol'; contract Macabris is ERC721, Governed { // Release contract address, used to whitelist calls to `onRelease` method address public releaseAddress; // Market contract address, used to whitelist calls to `onMarketSale` method address public marketAddress; // Bank contract Bank public bank; // Base URI of the token's metadata string public baseUri; // Personas sha256 hash (all UTF-8 names with a "\n" char after each name, sorted by token ID) bytes32 public immutable hash; /** * @param _hash Personas sha256 hash (all UTF-8 names with a "\n" char after each name, sorted by token ID) * @param governanceAddress Address of the Governance contract * * Requirements: * - Governance contract must be deployed at the given address */ constructor( bytes32 _hash, address governanceAddress ) ERC721('Macabris', 'MCBR') Governed(governanceAddress) { hash = _hash; } /** * @dev Sets the release contract address * @param _releaseAddress Address of the Release contract * * Requirements: * - the caller must have the bootstrap permission */ function setReleaseAddress(address _releaseAddress) external canBootstrap(msg.sender) { releaseAddress = _releaseAddress; } /** * @dev Sets the market contract address * @param _marketAddress Address of the Market contract * * Requirements: * - the caller must have the bootstrap permission */ function setMarketAddress(address _marketAddress) external canBootstrap(msg.sender) { marketAddress = _marketAddress; } /** * @dev Sets Bank contract address * @param bankAddress Address of the Bank contract * * Requirements: * - the caller must have the bootstrap permission * - Bank contract must be deployed at the given address */ function setBankAddress(address bankAddress) external canBootstrap(msg.sender) { bank = Bank(bankAddress); } /** * @dev Sets metadata base URI * @param _baseUri Base URI, token's ID will be appended at the end */ function setBaseUri(string memory _baseUri) external canConfigure(msg.sender) { baseUri = _baseUri; } /** * @dev Checks if the token exists * @param tokenId Token ID * @return True if token with given ID has been minted already, false otherwise */ function exists(uint256 tokenId) external view returns (bool) { return _exists(tokenId); } /** * @dev Overwrites to return base URI set by the contract owner */ function _baseURI() override internal view returns (string memory) { return baseUri; } function _transfer(address from, address to, uint256 tokenId) override internal { super._transfer(from, to, tokenId); bank.onTokenTransfer(tokenId, from, to); } function _mint(address to, uint256 tokenId) override internal { super._mint(to, tokenId); bank.onTokenTransfer(tokenId, address(0), to); } /** * @dev Registers new token after it's sold and revealed in the Release contract * @param tokenId Token ID * @param buyer Buyer address * * Requirements: * - The caller must be the Release contract * - `tokenId` must not exist * - Buyer cannot be the zero address * * Emits a {Transfer} event. */ function onRelease(uint256 tokenId, address buyer) external { require(msg.sender == releaseAddress, "Caller must be the Release contract"); // Also checks that the token does not exist and that the buyer is not 0 address. // Using unsafe mint to prevent a situation where a sale could not be revealed in the // realease contract, because the buyer address does not implement IERC721Receiver. _mint(buyer, tokenId); } /** * @dev Transfers token ownership after a sale on the Market contract * @param tokenId Token ID * @param seller Seller address * @param buyer Buyer address * * Requirements: * - The caller must be the Market contract * - `tokenId` must exist * - `seller` must be the owner of the token * - `buyer` cannot be the zero address * * Emits a {Transfer} event. */ function onMarketSale(uint256 tokenId, address seller, address buyer) external { require(msg.sender == marketAddress, "Caller must be the Market contract"); // Also checks if the token exists, if the seller is the current owner and that the buyer is // not 0 address. // Using unsafe transfer to prevent a situation where the token owner can't accept the // highest bid, because the bidder address does not implement IERC721Receiver. _transfer(seller, buyer, tokenId); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import './Governed.sol'; import './Bank.sol'; /** * @title Contract tracking deaths of Macabris tokens */ contract Reaper is Governed { // Bank contract Bank public bank; // Mapping from token ID to time of death mapping (uint256 => int64) private _deaths; /** * @dev Emitted when a token is marked as dead * @param tokenId Token ID * @param timeOfDeath Time of death (unix timestamp) */ event Death(uint256 indexed tokenId, int64 timeOfDeath); /** * @dev Emitted when a previosly dead token is marked as alive * @param tokenId Token ID */ event Resurrection(uint256 indexed tokenId); /** * @param governanceAddress Address of the Governance contract * * Requirements: * - Governance contract must be deployed at the given address */ constructor(address governanceAddress) Governed(governanceAddress) {} /** * @dev Sets Bank contract address * @param bankAddress Address of Bank contract * * Requirements: * - the caller must have the boostrap permission * - Bank contract must be deployed at the given address */ function setBankAddress(address bankAddress) external canBootstrap(msg.sender) { bank = Bank(bankAddress); } /** * @dev Marks token as dead and sets time of death * @param tokenId Token ID * @param timeOfDeath Tome of death (unix timestamp) * * Requirements: * - the caller must have permission to manage deaths * - `timeOfDeath` can't be 0 * * Note that tokenId doesn't have to be minted in order to be marked dead. * * Emits {Death} event */ function markDead(uint256 tokenId, int64 timeOfDeath) external canManageDeaths(msg.sender) { require(timeOfDeath != 0, "Time of death of 0 represents an alive token"); _deaths[tokenId] = timeOfDeath; bank.onTokenDeath(tokenId); emit Death(tokenId, timeOfDeath); } /** * @dev Marks token as alive * @param tokenId Token ID * * Requirements: * - the caller must have permission to manage deaths * - `tokenId` must be currently marked as dead * * Emits {Resurrection} event */ function markAlive(uint256 tokenId) external canManageDeaths(msg.sender) { require(_deaths[tokenId] != 0, "Token is not dead"); _deaths[tokenId] = 0; bank.onTokenResurrection(tokenId); emit Resurrection(tokenId); } /** * @dev Returns token's time of death * @param tokenId Token ID * @return Time of death (unix timestamp) or zero, if alive * * Note that any tokenId could be marked as dead, even not minted or not existant one. */ function getTimeOfDeath(uint256 tokenId) external view returns (int64) { return _deaths[tokenId]; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import './OwnerBalance.sol'; /** * @title Allows allocating portion of the contract's funds to the owner balance */ abstract contract OwnerBalanceContributor { // OwnerBalance contract address address public immutable ownerBalanceAddress; uint public ownerBalanceDeposits; /** * @param _ownerBalanceAddress Address of the OwnerBalance contract */ constructor (address _ownerBalanceAddress) { ownerBalanceAddress = _ownerBalanceAddress; } /** * @dev Assigns given amount of contract funds to the owner's balance * @param amount Amount in wei */ function _transferToOwnerBalance(uint amount) internal { ownerBalanceDeposits += amount; } /** * @dev Allows OwnerBalance contract to withdraw deposits * @param ownerAddress Owner address to send funds to * * Requirements: * - caller must be the OwnerBalance contract */ function withdrawOwnerBalanceDeposits(address ownerAddress) external { require(msg.sender == ownerBalanceAddress, 'Caller must be the OwnerBalance contract'); uint currentBalance = ownerBalanceDeposits; ownerBalanceDeposits = 0; payable(ownerAddress).transfer(currentBalance); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import './Governed.sol'; import './OwnerBalanceContributor.sol'; /** * @title Tracks owner's share of the funds in various Macabris contracts */ contract OwnerBalance is Governed { address public owner; // All three contracts, that contribute to the owner's balance OwnerBalanceContributor public release; OwnerBalanceContributor public bank; OwnerBalanceContributor public market; /** * @param governanceAddress Address of the Governance contract * * Requirements: * - Governance contract must be deployed at the given address */ constructor(address governanceAddress) Governed(governanceAddress) {} /** * @dev Sets the release contract address * @param releaseAddress Address of the Release contract * * Requirements: * - the caller must have the bootstrap permission */ function setReleaseAddress(address releaseAddress) external canBootstrap(msg.sender) { release = OwnerBalanceContributor(releaseAddress); } /** * @dev Sets Bank contract address * @param bankAddress Address of the Bank contract * * Requirements: * - the caller must have the bootstrap permission */ function setBankAddress(address bankAddress) external canBootstrap(msg.sender) { bank = OwnerBalanceContributor(bankAddress); } /** * @dev Sets the market contract address * @param marketAddress Address of the Market contract * * Requirements: * - the caller must have the bootstrap permission */ function setMarketAddress(address marketAddress) external canBootstrap(msg.sender) { market = OwnerBalanceContributor(marketAddress); } /** * @dev Sets owner address where the funds will be sent during withdrawal * @param _owner Owner's address * * Requirements: * - sender must have canSetOwnerAddress permission * - address must not be 0 */ function setOwner(address _owner) external canSetOwnerAddress(msg.sender) { require(_owner != address(0), "Empty owner address is not allowed!"); owner = _owner; } /** * @dev Returns total available balance in all contributing contracts * @return Balance in wei */ function getBalance() external view returns (uint) { uint balance; balance += release.ownerBalanceDeposits(); balance += bank.ownerBalanceDeposits(); balance += market.ownerBalanceDeposits(); return balance; } /** * @dev Withdraws available balance to the owner address * * Requirements: * - owner address must be set * - sender must have canTriggerOwnerWithdraw permission */ function withdraw() external canTriggerOwnerWithdraw(msg.sender) { require(owner != address(0), "Owner address is not set"); release.withdrawOwnerBalanceDeposits(owner); bank.withdrawOwnerBalanceDeposits(owner); market.withdrawOwnerBalanceDeposits(owner); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import './Governance.sol'; /** * @title Provides permission check modifiers for child contracts */ abstract contract Governed { // Governance contract Governance public immutable governance; /** * @param governanceAddress Address of the Governance contract * * Requirements: * - Governance contract must be deployed at the given address */ constructor (address governanceAddress) { governance = Governance(governanceAddress); } /** * @dev Throws if given address that doesn't have ManagesDeaths permission * @param subject Address to check permissions for, usually msg.sender */ modifier canManageDeaths(address subject) { require( governance.hasPermission(subject, Governance.Actions.ManageDeaths), "Governance: subject is not allowed to manage deaths" ); _; } /** * @dev Throws if given address that doesn't have Configure permission * @param subject Address to check permissions for, usually msg.sender */ modifier canConfigure(address subject) { require( governance.hasPermission(subject, Governance.Actions.Configure), "Governance: subject is not allowed to configure contracts" ); _; } /** * @dev Throws if given address that doesn't have Bootstrap permission * @param subject Address to check permissions for, usually msg.sender */ modifier canBootstrap(address subject) { require( governance.hasPermission(subject, Governance.Actions.Bootstrap), "Governance: subject is not allowed to bootstrap" ); _; } /** * @dev Throws if given address that doesn't have SetOwnerAddress permission * @param subject Address to check permissions for, usually msg.sender */ modifier canSetOwnerAddress(address subject) { require( governance.hasPermission(subject, Governance.Actions.SetOwnerAddress), "Governance: subject is not allowed to set owner address" ); _; } /** * @dev Throws if given address that doesn't have TriggerOwnerWithdraw permission * @param subject Address to check permissions for, usually msg.sender */ modifier canTriggerOwnerWithdraw(address subject) { require( governance.hasPermission(subject, Governance.Actions.TriggerOwnerWithdraw), "Governance: subject is not allowed to trigger owner withdraw" ); _; } /** * @dev Throws if given address that doesn't have StopPayouyts permission * @param subject Address to check permissions for, usually msg.sender */ modifier canStopPayouts(address subject) { require( governance.hasPermission(subject, Governance.Actions.StopPayouts), "Governance: subject is not allowed to stop payouts" ); _; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; /** * @title Manages address permissions to act on Macabris contracts */ contract Governance { enum Actions { Vote, Configure, SetOwnerAddress, TriggerOwnerWithdraw, ManageDeaths, StopPayouts, Bootstrap } // Stores permissions of an address struct Permissions { bool canVote; bool canConfigure; bool canSetOwnerAddress; bool canTriggerOwnerWithdraw; bool canManageDeaths; bool canStopPayouts; // Special permission that can't be voted in and only the deploying address receives bool canBootstrap; } // A call for vote to change address permissions struct CallForVote { // Address that will be assigned the permissions if the vote passes address subject; // Permissions to be assigned if the vote passes Permissions permissions; // Total number of votes for and against the permission change uint128 yeas; uint128 nays; } // A vote in a call for vote struct Vote { uint64 callForVoteIndex; bool yeaOrNay; } // Permissions of addresses mapping(address => Permissions) private permissions; // List of calls for a vote: callForVoteIndex => CallForVote, callForVoteIndex starts from 1 mapping(uint => CallForVote) private callsForVote; // Last registered call for vote of every address: address => callForVoteIndex mapping(address => uint64) private lastRegisteredCallForVote; // Votes of every address: address => Vote mapping(address => Vote) private votes; uint64 public resolvedCallsForVote; uint64 public totalCallsForVote; uint64 public totalVoters; /** * @dev Emitted when a new call for vote is registered * @param callForVoteIndex Index of the call for vote (1-based) * @param subject Subject address to change permissions to if vote passes * @param canVote Allow subject address to vote * @param canConfigure Allow subject address to configure prices, fees and base URI * @param canSetOwnerAddress Allows subject to change owner withdraw address * @param canTriggerOwnerWithdraw Allow subject address to trigger withdraw from owner's balance * @param canManageDeaths Allow subject to set tokens as dead or alive * @param canStopPayouts Allow subject to stop the bank payout schedule early */ event CallForVoteRegistered( uint64 indexed callForVoteIndex, address indexed caller, address indexed subject, bool canVote, bool canConfigure, bool canSetOwnerAddress, bool canTriggerOwnerWithdraw, bool canManageDeaths, bool canStopPayouts ); /** * @dev Emitted when a call for vote is resolved * @param callForVoteIndex Index of the call for vote (1-based) * @param yeas Total yeas for the call after the vote * @param nays Total nays for the call after the vote */ event CallForVoteResolved( uint64 indexed callForVoteIndex, uint128 yeas, uint128 nays ); /** * @dev Emitted when a vote is casted * @param callForVoteIndex Index of the call for vote (1-based) * @param voter Voter address * @param yeaOrNay Vote, true if yea, false if nay * @param totalVoters Total addresses with vote permission at the time of event * @param yeas Total yeas for the call after the vote * @param nays Total nays for the call after the vote */ event VoteCasted( uint64 indexed callForVoteIndex, address indexed voter, bool yeaOrNay, uint64 totalVoters, uint128 yeas, uint128 nays ); /** * @dev Inits the contract and gives the deployer address all permissions */ constructor() { _setPermissions(msg.sender, Permissions({ canVote: true, canConfigure: true, canSetOwnerAddress: true, canTriggerOwnerWithdraw: true, canManageDeaths: true, canStopPayouts: true, canBootstrap: true })); } /** * @dev Checks if the given address has permission to perform given action * @param subject Address to check * @param action Action to check permissions against * @return True if given address has permission to perform given action */ function hasPermission(address subject, Actions action) public view returns (bool) { if (action == Actions.ManageDeaths) { return permissions[subject].canManageDeaths; } if (action == Actions.Vote) { return permissions[subject].canVote; } if (action == Actions.SetOwnerAddress) { return permissions[subject].canSetOwnerAddress; } if (action == Actions.TriggerOwnerWithdraw) { return permissions[subject].canTriggerOwnerWithdraw; } if (action == Actions.Configure) { return permissions[subject].canConfigure; } if (action == Actions.StopPayouts) { return permissions[subject].canStopPayouts; } if (action == Actions.Bootstrap) { return permissions[subject].canBootstrap; } return false; } /** * Sets permissions for a given address * @param subject Subject address to set permissions to * @param _permissions Permissions */ function _setPermissions(address subject, Permissions memory _permissions) private { // Tracks count of total voting addresses to be able to calculate majority if (permissions[subject].canVote != _permissions.canVote) { if (_permissions.canVote) { totalVoters += 1; } else { totalVoters -= 1; // Cleaning up voting-related state for the address delete votes[subject]; delete lastRegisteredCallForVote[subject]; } } permissions[subject] = _permissions; } /** * @dev Registers a new call for vote to change address permissions * @param subject Subject address to change permissions to if vote passes * @param canVote Allow subject address to vote * @param canConfigure Allow subject address to configure prices, fees and base URI * @param canSetOwnerAddress Allows subject to change owner withdraw address * @param canTriggerOwnerWithdraw Allow subject address to trigger withdraw from owner's balance * @param canManageDeaths Allow subject to set tokens as dead or alive * @param canStopPayouts Allow subject to stop the bank payout schedule early * * Requirements: * - the caller must have the vote permission * - the caller shouldn't have any unresolved calls for vote */ function callForVote( address subject, bool canVote, bool canConfigure, bool canSetOwnerAddress, bool canTriggerOwnerWithdraw, bool canManageDeaths, bool canStopPayouts ) external { require( hasPermission(msg.sender, Actions.Vote), "Only addresses with vote permission can register a call for vote" ); // If the sender has previously created a call for vote that hasn't been resolved yet, // a second call for vote can't be registered. Prevents a denial of service attack, where // a minority of voters could flood the call for vote queue. require( lastRegisteredCallForVote[msg.sender] <= resolvedCallsForVote, "Only one active call for vote per address is allowed" ); totalCallsForVote++; lastRegisteredCallForVote[msg.sender] = totalCallsForVote; callsForVote[totalCallsForVote] = CallForVote({ subject: subject, permissions: Permissions({ canVote: canVote, canConfigure: canConfigure, canSetOwnerAddress: canSetOwnerAddress, canTriggerOwnerWithdraw: canTriggerOwnerWithdraw, canManageDeaths: canManageDeaths, canStopPayouts: canStopPayouts, canBootstrap: false }), yeas: 0, nays: 0 }); emit CallForVoteRegistered( totalCallsForVote, msg.sender, subject, canVote, canConfigure, canSetOwnerAddress, canTriggerOwnerWithdraw, canManageDeaths, canStopPayouts ); } /** * @dev Registers a vote * @param callForVoteIndex Call for vote index * @param yeaOrNay True to vote yea, false to vote nay * * Requirements: * - unresolved call for vote must exist * - call for vote index must match the current active call for vote * - the caller must have the vote permission */ function vote(uint64 callForVoteIndex, bool yeaOrNay) external { require(hasUnresolvedCallForVote(), "No unresolved call for vote exists"); require( callForVoteIndex == _getCurrenCallForVoteIndex(), "Call for vote does not exist or is not active" ); require( hasPermission(msg.sender, Actions.Vote), "Sender address does not have vote permission" ); uint128 yeas = callsForVote[callForVoteIndex].yeas; uint128 nays = callsForVote[callForVoteIndex].nays; // If the voter has already voted in this call for vote, undo the last vote if (votes[msg.sender].callForVoteIndex == callForVoteIndex) { if (votes[msg.sender].yeaOrNay) { yeas -= 1; } else { nays -= 1; } } if (yeaOrNay) { yeas += 1; } else { nays += 1; } emit VoteCasted(callForVoteIndex, msg.sender, yeaOrNay, totalVoters, yeas, nays); if (yeas == (totalVoters / 2 + 1) || nays == (totalVoters - totalVoters / 2)) { if (yeas > nays) { _setPermissions( callsForVote[callForVoteIndex].subject, callsForVote[callForVoteIndex].permissions ); } resolvedCallsForVote += 1; // Cleaning up what we can delete callsForVote[callForVoteIndex]; delete votes[msg.sender]; emit CallForVoteResolved(callForVoteIndex, yeas, nays); return; } votes[msg.sender] = Vote({ callForVoteIndex: callForVoteIndex, yeaOrNay: yeaOrNay }); callsForVote[callForVoteIndex].yeas = yeas; callsForVote[callForVoteIndex].nays = nays; } /** * @dev Returns information about the current unresolved call for vote * @return callForVoteIndex Call for vote index (1-based) * @return yeas Total yea votes * @return nays Total nay votes * * Requirements: * - Unresolved call for vote must exist */ function getCurrentCallForVote() public view returns ( uint64 callForVoteIndex, uint128 yeas, uint128 nays ) { require(hasUnresolvedCallForVote(), "No unresolved call for vote exists"); uint64 index = _getCurrenCallForVoteIndex(); return (index, callsForVote[index].yeas, callsForVote[index].nays); } /** * @dev Checks if there is an unresolved call for vote * @return True if an unresolved call for vote exists */ function hasUnresolvedCallForVote() public view returns (bool) { return totalCallsForVote > resolvedCallsForVote; } /** * @dev Returns current call for vote index * @return Call for vote index (1-based) * * Doesn't check if an unresolved call for vote exists, hasUnresolvedCallForVote should be used * before using the index that this method returns. */ function _getCurrenCallForVoteIndex() private view returns (uint64) { return resolvedCallsForVote + 1; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import './Governed.sol'; import './OwnerBalanceContributor.sol'; import './Macabris.sol'; import './Reaper.sol'; /** * @title Contract tracking payouts to token owners according to predefined schedule * * Payout schedule is dived into intervalCount intervals of intervalLength durations, starting at * startTime timestamp. After each interval, part of the payouts pool is distributed to the owners * of the tokens that are still alive. After the whole payout schedule is completed, all the funds * in the payout pool will have been distributed. * * There is a possibility of the payout schedule being stopped early. In that case, all of the * remaining funds will be distributed to the owners of the tokens that were alive at the time of * the payout schedule stop. */ contract Bank is Governed, OwnerBalanceContributor { // Macabris NFT contract Macabris public macabris; // Reaper contract Reaper public reaper; // Stores active token count change and deposits for an interval struct IntervalActivity { int128 activeTokenChange; uint128 deposits; } // Stores aggregate interval information struct IntervalTotals { uint index; uint deposits; uint payouts; uint accountPayouts; uint activeTokens; uint accountActiveTokens; } // The same as IntervalTotals, but a packed version to keep in the lastWithdrawTotals map. // Packed versions costs less to store, but the math is then more expensive duo to type // conversions, so the interval data is packed just before storing, and unpacked after loading. struct IntervalTotalsPacked { uint128 deposits; uint128 payouts; uint128 accountPayouts; uint48 activeTokens; uint48 accountActiveTokens; uint32 index; } // Timestamp of when the first interval starts uint64 public immutable startTime; // Timestamp of the moment the payouts have been stopped and the bank contents distributed. // This should remain 0, if the payout schedule is never stopped manually. uint64 public stopTime; // Total number of intervals uint64 public immutable intervalCount; // Interval length in seconds uint64 public immutable intervalLength; // Activity for each interval mapping(uint => IntervalActivity) private intervals; // Active token change for every interval for every address individually mapping(uint => mapping(address => int)) private individualIntervals; // Total withdrawn amount fo each address mapping(address => uint) private withdrawals; // Totals of the interval before the last withdrawal of an address mapping(address => IntervalTotalsPacked) private lastWithdrawTotals; /** * @param _startTime First interval start unix timestamp * @param _intervalCount Interval count * @param _intervalLength Interval length in seconds * @param governanceAddress Address of the Governance contract * @param ownerBalanceAddress Address of the OwnerBalance contract * * Requirements: * - interval length must be at least one second (but should be more like a month) * - interval count must be bigger than zero * - Governance contract must be deployed at the given address * - OwnerBalance contract must be deployed at the given address */ constructor( uint64 _startTime, uint64 _intervalCount, uint64 _intervalLength, address governanceAddress, address ownerBalanceAddress ) Governed(governanceAddress) OwnerBalanceContributor(ownerBalanceAddress) { require(_intervalLength > 0, "Interval length can't be zero"); require(_intervalCount > 0, "At least one interval is required"); startTime = _startTime; intervalCount = _intervalCount; intervalLength = _intervalLength; } /** * @dev Sets Macabris NFT contract address * @param macabrisAddress Address of Macabris NFT contract * * Requirements: * - the caller must have the bootstrap permission * - Macabris contract must be deployed at the given address */ function setMacabrisAddress(address macabrisAddress) external canBootstrap(msg.sender) { macabris = Macabris(macabrisAddress); } /** * @dev Sets Reaper contract address * @param reaperAddress Address of Reaper contract * * Requirements: * - the caller must have the bootstrap permission * - Reaper contract must be deployed at the given address */ function setReaperAddress(address reaperAddress) external canBootstrap(msg.sender) { reaper = Reaper(reaperAddress); } /** * @dev Stops payouts, distributes remaining funds among alive tokens * * Requirements: * - the caller must have the stop payments permission * - the payout schedule must not have been stopped previously * - the payout schedule should not be completed */ function stopPayouts() external canStopPayouts(msg.sender) { require(stopTime == 0, "Payouts are already stopped"); require(block.timestamp < getEndTime(), "Payout schedule is already completed"); stopTime = uint64(block.timestamp); } /** * @dev Checks if the payouts are finished or have been stopped manually * @return True if finished or stopped */ function hasEnded() public view returns (bool) { return stopTime > 0 || block.timestamp >= getEndTime(); } /** * @dev Returns timestamp of the first second after the last interval * @return Unix timestamp */ function getEndTime() public view returns(uint) { return _getIntervalStartTime(intervalCount); } /** * @dev Returns a timestamp of the first second of the given interval * @return Unix timestamp * * Doesn't make any bound checks for the given interval! */ function _getIntervalStartTime(uint interval) private view returns(uint) { return startTime + interval * intervalLength; } /** * @dev Returns start time of the upcoming interval * @return Unix timestamp */ function getNextIntervalStartTime() public view returns (uint) { // If the payouts were ended manually, there will be no next interval if (stopTime > 0) { return 0; } // Returns first intervals start time if the payout schedule hasn't started yet if (block.timestamp < startTime) { return startTime; } uint currentInterval = _getInterval(block.timestamp); // There will be no intervals after the last one, return 0 if (currentInterval >= (intervalCount - 1)) { return 0; } // Returns next interval's start time otherwise return _getIntervalStartTime(currentInterval + 1); } /** * @dev Deposits ether to the common payout pool */ function deposit() external payable { // If the payouts have ended, we don't need to track deposits anymore, everything goes to // the owner's balance if (hasEnded()) { _transferToOwnerBalance(msg.value); return; } require(msg.value <= type(uint128).max, "Deposits bigger than uint128 max value are not allowed!"); uint currentInterval = _getInterval(block.timestamp); intervals[currentInterval].deposits += uint128(msg.value); } /** * @dev Registers token transfer, minting and burning * @param tokenId Token ID * @param from Previous token owner, zero if this is a freshly minted token * @param to New token owner, zero if the token is being burned * * Requirements: * - the caller must be the Macabris contract */ function onTokenTransfer(uint tokenId, address from, address to) external { require(msg.sender == address(macabris), "Caller must be the Macabris contract"); // If the payouts have ended, we don't need to track transfers anymore if (hasEnded()) { return; } // If token is already dead, nothing changes in terms of payouts if (reaper.getTimeOfDeath(tokenId) != 0) { return; } uint currentInterval = _getInterval(block.timestamp); if (from == address(0)) { // If the token is freshly minted, increase the total active token count for the period intervals[currentInterval].activeTokenChange += 1; } else { // If the token is transfered, decrease the previous ownner's total for the current interval individualIntervals[currentInterval][from] -= 1; } if (to == address(0)) { // If the token is burned, decrease the total active token count for the period intervals[currentInterval].activeTokenChange -= 1; } else { // If the token is transfered, add it to the receiver's total for the current interval individualIntervals[currentInterval][to] += 1; } } /** * @dev Registers token death * @param tokenId Token ID * * Requirements: * - the caller must be the Reaper contract */ function onTokenDeath(uint tokenId) external { require(msg.sender == address(reaper), "Caller must be the Reaper contract"); // If the payouts have ended, we don't need to track deaths anymore if (hasEnded()) { return; } // If the token isn't minted yet, we don't care about it if (!macabris.exists(tokenId)) { return; } uint currentInterval = _getInterval(block.timestamp); address owner = macabris.ownerOf(tokenId); intervals[currentInterval].activeTokenChange -= 1; individualIntervals[currentInterval][owner] -= 1; } /** * @dev Registers token resurrection * @param tokenId Token ID * * Requirements: * - the caller must be the Reaper contract */ function onTokenResurrection(uint tokenId) external { require(msg.sender == address(reaper), "Caller must be the Reaper contract"); // If the payouts have ended, we don't need to track deaths anymore if (hasEnded()) { return; } // If the token isn't minted yet, we don't care about it if (!macabris.exists(tokenId)) { return; } uint currentInterval = _getInterval(block.timestamp); address owner = macabris.ownerOf(tokenId); intervals[currentInterval].activeTokenChange += 1; individualIntervals[currentInterval][owner] += 1; } /** * Returns current interval index * @return Interval index (0 for the first interval, intervalCount-1 for the last) * * Notes: * - Returns zero (first interval), if the first interval hasn't started yet * - Returns the interval at the stop time, if the payouts have been stopped * - Returns "virtual" interval after the last one, if the payout schedule is completed */ function _getCurrentInterval() private view returns(uint) { // If the payouts have been stopped, return interval after the stopped one if (stopTime > 0) { return _getInterval(stopTime); } uint intervalIndex = _getInterval(block.timestamp); // Return "virtual" interval that would come after the last one, if payout schedule is completed if (intervalIndex > intervalCount) { return intervalCount; } return intervalIndex; } /** * Returns interval index for the given timestamp * @return Interval index (0 for the first interval, intervalCount-1 for the last) * * Notes: * - Returns zero (first interval), if the first interval hasn't started yet * - Returns non-exitent interval index, if the timestamp is after the end time */ function _getInterval(uint timestamp) private view returns(uint) { // Time before the payout schedule start is considered to be a part of the first interval if (timestamp < startTime) { return 0; } return (timestamp - startTime) / intervalLength; } /** * @dev Returns total pool value (deposits - payouts) for the current interval * @return Current pool value in wei */ function getPoolValue() public view returns (uint) { // If all the payouts are done, pool is empty. In reality, there might something left due to // last interval pool not dividing equaly between the remaining alive tokens, or if there // are no alive tokens during the last interval. if (hasEnded()) { return 0; } uint currentInterval = _getInterval(block.timestamp); IntervalTotals memory totals = _getIntervalTotals(currentInterval, address(0)); return totals.deposits - totals.payouts; } /** * @dev Returns provisional next payout value per active token of the current interval * @return Payout in wei, zero if no active tokens exist or all payouts are done */ function getNextPayout() external view returns (uint) { // There is no next payout if the payout schedule has run its course if (hasEnded()) { return 0; } uint currentInterval = _getInterval(block.timestamp); IntervalTotals memory totals = _getIntervalTotals(currentInterval, address(0)); return _getPayoutPerToken(totals); } /** * @dev Returns payout amount per token for the given interval * @param totals Interval totals * @return Payout value in wei * * Notes: * - Returns zero for the "virtual" interval after the payout schedule end * - Returns zero if no active tokens exists for the interval */ function _getPayoutPerToken(IntervalTotals memory totals) private view returns (uint) { // If we're calculating next payout for the "virtual" interval after the last one, // or if there are no active tokens, we would be dividing the pool by zero if (totals.activeTokens > 0 && totals.index < intervalCount) { return (totals.deposits - totals.payouts) / (intervalCount - totals.index) / totals.activeTokens; } else { return 0; } } /** * @dev Returns the sum of all payouts made up until this interval * @return Payouts total in wei */ function getPayoutsTotal() external view returns (uint) { uint interval = _getCurrentInterval(); IntervalTotals memory totals = _getIntervalTotals(interval, address(0)); uint payouts = totals.payouts; // If the payout schedule has been stopped prematurely, all deposits are distributed. // If there are no active tokens, the remainder of the pool is never distributed. if (stopTime > 0 && totals.activeTokens > 0) { // Remaining pool might not divide equally between the active tokens, calculating // distributed amount without the remainder payouts += (totals.deposits - totals.payouts) / totals.activeTokens * totals.activeTokens; } return payouts; } /** * @dev Returns the sum of payouts for a particular account * @param account Account address * @return Payouts total in wei */ function getAccountPayouts(address account) public view returns (uint) { uint interval = _getCurrentInterval(); IntervalTotals memory totals = _getIntervalTotals(interval, account); uint accountPayouts = totals.accountPayouts; // If the payout schedule has been stopped prematurely, all deposits are distributed. // If there are no active tokens, the remainder of the pool is never distributed. if (stopTime > 0 && totals.activeTokens > 0) { accountPayouts += (totals.deposits - totals.payouts) / totals.activeTokens * totals.accountActiveTokens; } return accountPayouts; } /** * @dev Returns amount available for withdrawal * @param account Address to return balance for * @return Amount int wei */ function getBalance(address account) public view returns (uint) { return getAccountPayouts(account) - withdrawals[account]; } /** * @dev Withdraws all available amount * @param account Address to withdraw for * * Note that this method can be called by any address. */ function withdraw(address payable account) external { uint interval = _getCurrentInterval(); // Persists last finished interval totals to avoid having to recalculate them from the // deltas during the next withdrawal. Totals of the first interval should never be saved // to the lastWithdrawTotals map (see _getIntervalTotals for explanation). if (interval > 1) { IntervalTotals memory totals = _getIntervalTotals(interval - 1, account); // Converting the totals struct to a packed version before saving to storage to save gas lastWithdrawTotals[account] = IntervalTotalsPacked({ deposits: uint128(totals.deposits), payouts: uint128(totals.payouts), accountPayouts: uint128(totals.accountPayouts), activeTokens: uint48(totals.activeTokens), accountActiveTokens: uint48(totals.accountActiveTokens), index: uint32(totals.index) }); } uint balance = getBalance(account); withdrawals[account] += balance; account.transfer(balance); } /** * @dev Aggregates active token and deposit change history until the given interval * @param intervalIndex Interval * @param account Account for account-specific aggregate values * @return Aggregate values for the interval */ function _getIntervalTotals(uint intervalIndex, address account) private view returns (IntervalTotals memory) { IntervalTotalsPacked storage packed = lastWithdrawTotals[account]; // Converting packed totals struct back to unpacked one, to avoid having to do type // conversions in the loop below. IntervalTotals memory totals = IntervalTotals({ index: packed.index, deposits: packed.deposits, payouts: packed.payouts, accountPayouts: packed.accountPayouts, activeTokens: packed.activeTokens, accountActiveTokens: packed.accountActiveTokens }); uint prevPayout; uint prevAccountPayout; uint prevPayoutPerToken; // If we don't have previous totals, we need to start from intervalIndex 0 to apply the // active token and deposit changes of the first interval. If we have previous totals, they // the include all the activity of the interval already, so we start from the next one. // // Note that it's assumed all the interval total values will be 0, if the totals.index is 0. // This means that the totals of the first interval should never be saved to the // lastWithdrawTotals maps otherwise the deposits and active token changes will be counted twice. for (uint i = totals.index > 0 ? totals.index + 1 : 0; i <= intervalIndex; i++) { // Calculating payouts for the last interval data. If this is the first interval and // there was no previous interval totals, all these values will resolve to 0. prevPayoutPerToken = _getPayoutPerToken(totals); prevPayout = prevPayoutPerToken * totals.activeTokens; prevAccountPayout = totals.accountActiveTokens * prevPayoutPerToken; // Updating totals to represent the current interval by adding the payouts of the last // interval and applying changes in active token count and deposits totals.index = i; totals.payouts += prevPayout; totals.accountPayouts += prevAccountPayout; IntervalActivity storage interval = intervals[i]; totals.deposits += interval.deposits; // Even though the token change value might be negative, the sum of all the changes // will never be negative because of the implicit contrains of the contracts (e.g. token // can't be transfered from an address that does not own it, or already dead token can't // be marked dead again). Therefore it's safe to convert the result into unsigned value, // after doing sum of signed values. totals.activeTokens = uint(int(totals.activeTokens) + interval.activeTokenChange); totals.accountActiveTokens = uint(int(totals.accountActiveTokens) + individualIntervals[i][account]); } return totals; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.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 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"address","name":"governanceAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bank","outputs":[{"internalType":"contract Bank","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"contract Governance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"address","name":"buyer","type":"address"}],"name":"onMarketSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"buyer","type":"address"}],"name":"onRelease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"releaseAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bankAddress","type":"address"}],"name":"setBankAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_marketAddress","type":"address"}],"name":"setMarketAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_releaseAddress","type":"address"}],"name":"setReleaseAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001fc838038062001fc8833981016040819052620000349162000156565b60408051808201825260088152674d6163616272697360c01b60208083019182528351808501909452600484526326a1a12960e11b908401528151849391620000819160009190620000b0565b50805162000097906001906020840190620000b0565b5050506001600160a01b03166080525060a052620001d2565b828054620000be9062000195565b90600052602060002090601f016020900481019282620000e257600085556200012d565b82601f10620000fd57805160ff19168380011785556200012d565b828001600101855582156200012d579182015b828111156200012d57825182559160200191906001019062000110565b506200013b9291506200013f565b5090565b5b808211156200013b576000815560010162000140565b600080604083850312156200016a57600080fd5b825160208401519092506001600160a01b03811681146200018a57600080fd5b809150509250929050565b600181811c90821680620001aa57607f821691505b60208210811415620001cc57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051611db46200021460003960006102150152600081816102830152818161091e01528181610b4101528181610cfc0152610e500152611db46000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c806395623641116100de578063c2e2b29211610097578063e985e9c511610071578063e985e9c514610386578063fae92612146103c2578063fbfbfff9146103d5578063fc3c0eee146103e857600080fd5b8063c2e2b2921461034d578063c87b56dd14610360578063da2a4d2b1461037357600080fd5b806395623641146102f157806395d89b41146103045780639abc83201461030c578063a0bcfc7f14610314578063a22cb46514610327578063b88d4fde1461033a57600080fd5b806342842e0e1161014b5780636352211e116101255780636352211e146102a557806370548e18146102b857806370a08231146102cb57806376cdb03b146102de57600080fd5b806342842e0e146102585780634f558e791461026b5780635aa6e6751461027e57600080fd5b806301ffc9a71461019357806306fdde03146101bb578063081812fc146101d0578063095ea7b3146101fb57806309bd5a601461021057806323b872dd14610245575b600080fd5b6101a66101a1366004611756565b6103fb565b60405190151581526020015b60405180910390f35b6101c361044d565b6040516101b291906117cb565b6101e36101de3660046117de565b6104df565b6040516001600160a01b0390911681526020016101b2565b61020e610209366004611813565b610579565b005b6102377f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016101b2565b61020e61025336600461183d565b61068f565b61020e61026636600461183d565b6106c0565b6101a66102793660046117de565b6106db565b6101e37f000000000000000000000000000000000000000000000000000000000000000081565b6101e36102b33660046117de565b6106fa565b61020e6102c6366004611879565b610771565b6102376102d93660046118b5565b6107e1565b6008546101e3906001600160a01b031681565b6007546101e3906001600160a01b031681565b6101c3610868565b6101c3610877565b61020e61032236600461195c565b610905565b61020e6103353660046119b3565b610a2b565b61020e6103483660046119ea565b610af0565b61020e61035b3660046118b5565b610b28565b6101c361036e3660046117de565b610c08565b6006546101e3906001600160a01b031681565b6101a6610394366004611a66565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61020e6103d03660046118b5565b610ce3565b61020e6103e3366004611a99565b610dc3565b61020e6103f63660046118b5565b610e37565b60006001600160e01b031982166380ac58cd60e01b148061042c57506001600160e01b03198216635b5e139f60e01b145b8061044757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606000805461045c90611abc565b80601f016020809104026020016040519081016040528092919081815260200182805461048890611abc565b80156104d55780601f106104aa576101008083540402835291602001916104d5565b820191906000526020600020905b8154815290600101906020018083116104b857829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661055d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610584826106fa565b9050806001600160a01b0316836001600160a01b031614156105f25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610554565b336001600160a01b038216148061060e575061060e8133610394565b6106805760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610554565b61068a8383610f17565b505050565b6106993382610f85565b6106b55760405162461bcd60e51b815260040161055490611af7565b61068a83838361107c565b61068a83838360405180602001604052806000815250610af0565b6000818152600260205260408120546001600160a01b03161515610447565b6000818152600260205260408120546001600160a01b0316806104475760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610554565b6007546001600160a01b031633146107d65760405162461bcd60e51b815260206004820152602260248201527f43616c6c6572206d75737420626520746865204d61726b657420636f6e74726160448201526118dd60f21b6064820152608401610554565b61068a82828561107c565b60006001600160a01b03821661084c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610554565b506001600160a01b031660009081526003602052604090205490565b60606001805461045c90611abc565b6009805461088490611abc565b80601f01602080910402602001604051908101604052809291908181526020018280546108b090611abc565b80156108fd5780601f106108d2576101008083540402835291602001916108fd565b820191906000526020600020905b8154815290600101906020018083116108e057829003601f168201915b505050505081565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906363e85d2d90610956908490600190600401611b48565b60206040518083038186803b15801561096e57600080fd5b505afa158015610982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a69190611b83565b610a185760405162461bcd60e51b815260206004820152603960248201527f476f7665726e616e63653a207375626a656374206973206e6f7420616c6c6f7760448201527f656420746f20636f6e66696775726520636f6e747261637473000000000000006064820152608401610554565b815161068a9060099060208501906116a4565b6001600160a01b038216331415610a845760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610554565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610afa3383610f85565b610b165760405162461bcd60e51b815260040161055490611af7565b610b22848484846110fa565b50505050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906363e85d2d90610b79908490600690600401611b48565b60206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611b83565b610be55760405162461bcd60e51b815260040161055490611ba0565b50600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260409020546060906001600160a01b0316610c875760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610554565b6000610c9161112d565b90506000815111610cb15760405180602001604052806000815250610cdc565b80610cbb8461113c565b604051602001610ccc929190611bef565b6040516020818303038152906040525b9392505050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906363e85d2d90610d34908490600690600401611b48565b60206040518083038186803b158015610d4c57600080fd5b505afa158015610d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d849190611b83565b610da05760405162461bcd60e51b815260040161055490611ba0565b50600780546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b03163314610e295760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206d757374206265207468652052656c6561736520636f6e74726044820152621858dd60ea1b6064820152608401610554565b610e33818361123a565b5050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906363e85d2d90610e88908490600690600401611b48565b60206040518083038186803b158015610ea057600080fd5b505afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed89190611b83565b610ef45760405162461bcd60e51b815260040161055490611ba0565b50600880546001600160a01b0319166001600160a01b0392909216919091179055565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610f4c826106fa565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610ffe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610554565b6000611009836106fa565b9050806001600160a01b0316846001600160a01b031614806110445750836001600160a01b0316611039846104df565b6001600160a01b0316145b8061107457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b6110878383836112b5565b600854604051633536840760e01b8152600481018390526001600160a01b038581166024830152848116604483015290911690633536840790606401600060405180830381600087803b1580156110dd57600080fd5b505af11580156110f1573d6000803e3d6000fd5b50505050505050565b61110584848461107c565b61111184848484611455565b610b225760405162461bcd60e51b815260040161055490611c1e565b60606009805461045c90611abc565b6060816111605750506040805180820190915260018152600360fc1b602082015290565b8160005b811561118a578061117481611c86565b91506111839050600a83611cb7565b9150611164565b60008167ffffffffffffffff8111156111a5576111a56118d0565b6040519080825280601f01601f1916602001820160405280156111cf576020820181803683370190505b5090505b8415611074576111e4600183611ccb565b91506111f1600a86611ce2565b6111fc906030611cf6565b60f81b81838151811061121157611211611d0e565b60200101906001600160f81b031916908160001a905350611233600a86611cb7565b94506111d3565b6112448282611562565b600854604051633536840760e01b815260048101839052600060248201526001600160a01b03848116604483015290911690633536840790606401600060405180830381600087803b15801561129957600080fd5b505af11580156112ad573d6000803e3d6000fd5b505050505050565b826001600160a01b03166112c8826106fa565b6001600160a01b0316146113305760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610554565b6001600160a01b0382166113925760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610554565b61139d600082610f17565b6001600160a01b03831660009081526003602052604081208054600192906113c6908490611ccb565b90915550506001600160a01b03821660009081526003602052604081208054600192906113f4908490611cf6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1561155757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611499903390899088908890600401611d24565b602060405180830381600087803b1580156114b357600080fd5b505af19250505080156114e3575060408051601f3d908101601f191682019092526114e091810190611d61565b60015b61153d573d808015611511576040519150601f19603f3d011682016040523d82523d6000602084013e611516565b606091505b5080516115355760405162461bcd60e51b815260040161055490611c1e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611074565b506001949350505050565b6001600160a01b0382166115b85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610554565b6000818152600260205260409020546001600160a01b03161561161d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610554565b6001600160a01b0382166000908152600360205260408120805460019290611646908490611cf6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546116b090611abc565b90600052602060002090601f0160209004810192826116d25760008555611718565b82601f106116eb57805160ff1916838001178555611718565b82800160010185558215611718579182015b828111156117185782518255916020019190600101906116fd565b50611724929150611728565b5090565b5b808211156117245760008155600101611729565b6001600160e01b03198116811461175357600080fd5b50565b60006020828403121561176857600080fd5b8135610cdc8161173d565b60005b8381101561178e578181015183820152602001611776565b83811115610b225750506000910152565b600081518084526117b7816020860160208601611773565b601f01601f19169290920160200192915050565b602081526000610cdc602083018461179f565b6000602082840312156117f057600080fd5b5035919050565b80356001600160a01b038116811461180e57600080fd5b919050565b6000806040838503121561182657600080fd5b61182f836117f7565b946020939093013593505050565b60008060006060848603121561185257600080fd5b61185b846117f7565b9250611869602085016117f7565b9150604084013590509250925092565b60008060006060848603121561188e57600080fd5b8335925061189e602085016117f7565b91506118ac604085016117f7565b90509250925092565b6000602082840312156118c757600080fd5b610cdc826117f7565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611901576119016118d0565b604051601f8501601f19908116603f01168101908282118183101715611929576119296118d0565b8160405280935085815286868601111561194257600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561196e57600080fd5b813567ffffffffffffffff81111561198557600080fd5b8201601f8101841361199657600080fd5b611074848235602084016118e6565b801515811461175357600080fd5b600080604083850312156119c657600080fd5b6119cf836117f7565b915060208301356119df816119a5565b809150509250929050565b60008060008060808587031215611a0057600080fd5b611a09856117f7565b9350611a17602086016117f7565b925060408501359150606085013567ffffffffffffffff811115611a3a57600080fd5b8501601f81018713611a4b57600080fd5b611a5a878235602084016118e6565b91505092959194509250565b60008060408385031215611a7957600080fd5b611a82836117f7565b9150611a90602084016117f7565b90509250929050565b60008060408385031215611aac57600080fd5b82359150611a90602084016117f7565b600181811c90821680611ad057607f821691505b60208210811415611af157634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6001600160a01b03831681526040810160078310611b7657634e487b7160e01b600052602160045260246000fd5b8260208301529392505050565b600060208284031215611b9557600080fd5b8151610cdc816119a5565b6020808252602f908201527f476f7665726e616e63653a207375626a656374206973206e6f7420616c6c6f7760408201526e0656420746f20626f6f74737472617608c1b606082015260800190565b60008351611c01818460208801611773565b835190830190611c15818360208801611773565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c9a57611c9a611c70565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082611cc657611cc6611ca1565b500490565b600082821015611cdd57611cdd611c70565b500390565b600082611cf157611cf1611ca1565b500690565b60008219821115611d0957611d09611c70565b500190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611d579083018461179f565b9695505050505050565b600060208284031215611d7357600080fd5b8151610cdc8161173d56fea26469706673582212202e8b9b94d7199e02b295e333b534a5c8de0af4d4f07d70fb75a33378f91faeb064736f6c63430008090033afb12e5c8f4f6d5ea9a3c7ee77ef964b2cae95df8dc02113b3781f546e6132db000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e956
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806395623641116100de578063c2e2b29211610097578063e985e9c511610071578063e985e9c514610386578063fae92612146103c2578063fbfbfff9146103d5578063fc3c0eee146103e857600080fd5b8063c2e2b2921461034d578063c87b56dd14610360578063da2a4d2b1461037357600080fd5b806395623641146102f157806395d89b41146103045780639abc83201461030c578063a0bcfc7f14610314578063a22cb46514610327578063b88d4fde1461033a57600080fd5b806342842e0e1161014b5780636352211e116101255780636352211e146102a557806370548e18146102b857806370a08231146102cb57806376cdb03b146102de57600080fd5b806342842e0e146102585780634f558e791461026b5780635aa6e6751461027e57600080fd5b806301ffc9a71461019357806306fdde03146101bb578063081812fc146101d0578063095ea7b3146101fb57806309bd5a601461021057806323b872dd14610245575b600080fd5b6101a66101a1366004611756565b6103fb565b60405190151581526020015b60405180910390f35b6101c361044d565b6040516101b291906117cb565b6101e36101de3660046117de565b6104df565b6040516001600160a01b0390911681526020016101b2565b61020e610209366004611813565b610579565b005b6102377fafb12e5c8f4f6d5ea9a3c7ee77ef964b2cae95df8dc02113b3781f546e6132db81565b6040519081526020016101b2565b61020e61025336600461183d565b61068f565b61020e61026636600461183d565b6106c0565b6101a66102793660046117de565b6106db565b6101e37f000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e95681565b6101e36102b33660046117de565b6106fa565b61020e6102c6366004611879565b610771565b6102376102d93660046118b5565b6107e1565b6008546101e3906001600160a01b031681565b6007546101e3906001600160a01b031681565b6101c3610868565b6101c3610877565b61020e61032236600461195c565b610905565b61020e6103353660046119b3565b610a2b565b61020e6103483660046119ea565b610af0565b61020e61035b3660046118b5565b610b28565b6101c361036e3660046117de565b610c08565b6006546101e3906001600160a01b031681565b6101a6610394366004611a66565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61020e6103d03660046118b5565b610ce3565b61020e6103e3366004611a99565b610dc3565b61020e6103f63660046118b5565b610e37565b60006001600160e01b031982166380ac58cd60e01b148061042c57506001600160e01b03198216635b5e139f60e01b145b8061044757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606000805461045c90611abc565b80601f016020809104026020016040519081016040528092919081815260200182805461048890611abc565b80156104d55780601f106104aa576101008083540402835291602001916104d5565b820191906000526020600020905b8154815290600101906020018083116104b857829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661055d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610584826106fa565b9050806001600160a01b0316836001600160a01b031614156105f25760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610554565b336001600160a01b038216148061060e575061060e8133610394565b6106805760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610554565b61068a8383610f17565b505050565b6106993382610f85565b6106b55760405162461bcd60e51b815260040161055490611af7565b61068a83838361107c565b61068a83838360405180602001604052806000815250610af0565b6000818152600260205260408120546001600160a01b03161515610447565b6000818152600260205260408120546001600160a01b0316806104475760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610554565b6007546001600160a01b031633146107d65760405162461bcd60e51b815260206004820152602260248201527f43616c6c6572206d75737420626520746865204d61726b657420636f6e74726160448201526118dd60f21b6064820152608401610554565b61068a82828561107c565b60006001600160a01b03821661084c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610554565b506001600160a01b031660009081526003602052604090205490565b60606001805461045c90611abc565b6009805461088490611abc565b80601f01602080910402602001604051908101604052809291908181526020018280546108b090611abc565b80156108fd5780601f106108d2576101008083540402835291602001916108fd565b820191906000526020600020905b8154815290600101906020018083116108e057829003601f168201915b505050505081565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e95616906363e85d2d90610956908490600190600401611b48565b60206040518083038186803b15801561096e57600080fd5b505afa158015610982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a69190611b83565b610a185760405162461bcd60e51b815260206004820152603960248201527f476f7665726e616e63653a207375626a656374206973206e6f7420616c6c6f7760448201527f656420746f20636f6e66696775726520636f6e747261637473000000000000006064820152608401610554565b815161068a9060099060208501906116a4565b6001600160a01b038216331415610a845760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610554565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610afa3383610f85565b610b165760405162461bcd60e51b815260040161055490611af7565b610b22848484846110fa565b50505050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e95616906363e85d2d90610b79908490600690600401611b48565b60206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611b83565b610be55760405162461bcd60e51b815260040161055490611ba0565b50600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260409020546060906001600160a01b0316610c875760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610554565b6000610c9161112d565b90506000815111610cb15760405180602001604052806000815250610cdc565b80610cbb8461113c565b604051602001610ccc929190611bef565b6040516020818303038152906040525b9392505050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e95616906363e85d2d90610d34908490600690600401611b48565b60206040518083038186803b158015610d4c57600080fd5b505afa158015610d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d849190611b83565b610da05760405162461bcd60e51b815260040161055490611ba0565b50600780546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b03163314610e295760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206d757374206265207468652052656c6561736520636f6e74726044820152621858dd60ea1b6064820152608401610554565b610e33818361123a565b5050565b6040516363e85d2d60e01b815233906001600160a01b037f000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e95616906363e85d2d90610e88908490600690600401611b48565b60206040518083038186803b158015610ea057600080fd5b505afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed89190611b83565b610ef45760405162461bcd60e51b815260040161055490611ba0565b50600880546001600160a01b0319166001600160a01b0392909216919091179055565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610f4c826106fa565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610ffe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610554565b6000611009836106fa565b9050806001600160a01b0316846001600160a01b031614806110445750836001600160a01b0316611039846104df565b6001600160a01b0316145b8061107457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b6110878383836112b5565b600854604051633536840760e01b8152600481018390526001600160a01b038581166024830152848116604483015290911690633536840790606401600060405180830381600087803b1580156110dd57600080fd5b505af11580156110f1573d6000803e3d6000fd5b50505050505050565b61110584848461107c565b61111184848484611455565b610b225760405162461bcd60e51b815260040161055490611c1e565b60606009805461045c90611abc565b6060816111605750506040805180820190915260018152600360fc1b602082015290565b8160005b811561118a578061117481611c86565b91506111839050600a83611cb7565b9150611164565b60008167ffffffffffffffff8111156111a5576111a56118d0565b6040519080825280601f01601f1916602001820160405280156111cf576020820181803683370190505b5090505b8415611074576111e4600183611ccb565b91506111f1600a86611ce2565b6111fc906030611cf6565b60f81b81838151811061121157611211611d0e565b60200101906001600160f81b031916908160001a905350611233600a86611cb7565b94506111d3565b6112448282611562565b600854604051633536840760e01b815260048101839052600060248201526001600160a01b03848116604483015290911690633536840790606401600060405180830381600087803b15801561129957600080fd5b505af11580156112ad573d6000803e3d6000fd5b505050505050565b826001600160a01b03166112c8826106fa565b6001600160a01b0316146113305760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610554565b6001600160a01b0382166113925760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610554565b61139d600082610f17565b6001600160a01b03831660009081526003602052604081208054600192906113c6908490611ccb565b90915550506001600160a01b03821660009081526003602052604081208054600192906113f4908490611cf6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1561155757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611499903390899088908890600401611d24565b602060405180830381600087803b1580156114b357600080fd5b505af19250505080156114e3575060408051601f3d908101601f191682019092526114e091810190611d61565b60015b61153d573d808015611511576040519150601f19603f3d011682016040523d82523d6000602084013e611516565b606091505b5080516115355760405162461bcd60e51b815260040161055490611c1e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611074565b506001949350505050565b6001600160a01b0382166115b85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610554565b6000818152600260205260409020546001600160a01b03161561161d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610554565b6001600160a01b0382166000908152600360205260408120805460019290611646908490611cf6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546116b090611abc565b90600052602060002090601f0160209004810192826116d25760008555611718565b82601f106116eb57805160ff1916838001178555611718565b82800160010185558215611718579182015b828111156117185782518255916020019190600101906116fd565b50611724929150611728565b5090565b5b808211156117245760008155600101611729565b6001600160e01b03198116811461175357600080fd5b50565b60006020828403121561176857600080fd5b8135610cdc8161173d565b60005b8381101561178e578181015183820152602001611776565b83811115610b225750506000910152565b600081518084526117b7816020860160208601611773565b601f01601f19169290920160200192915050565b602081526000610cdc602083018461179f565b6000602082840312156117f057600080fd5b5035919050565b80356001600160a01b038116811461180e57600080fd5b919050565b6000806040838503121561182657600080fd5b61182f836117f7565b946020939093013593505050565b60008060006060848603121561185257600080fd5b61185b846117f7565b9250611869602085016117f7565b9150604084013590509250925092565b60008060006060848603121561188e57600080fd5b8335925061189e602085016117f7565b91506118ac604085016117f7565b90509250925092565b6000602082840312156118c757600080fd5b610cdc826117f7565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611901576119016118d0565b604051601f8501601f19908116603f01168101908282118183101715611929576119296118d0565b8160405280935085815286868601111561194257600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561196e57600080fd5b813567ffffffffffffffff81111561198557600080fd5b8201601f8101841361199657600080fd5b611074848235602084016118e6565b801515811461175357600080fd5b600080604083850312156119c657600080fd5b6119cf836117f7565b915060208301356119df816119a5565b809150509250929050565b60008060008060808587031215611a0057600080fd5b611a09856117f7565b9350611a17602086016117f7565b925060408501359150606085013567ffffffffffffffff811115611a3a57600080fd5b8501601f81018713611a4b57600080fd5b611a5a878235602084016118e6565b91505092959194509250565b60008060408385031215611a7957600080fd5b611a82836117f7565b9150611a90602084016117f7565b90509250929050565b60008060408385031215611aac57600080fd5b82359150611a90602084016117f7565b600181811c90821680611ad057607f821691505b60208210811415611af157634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6001600160a01b03831681526040810160078310611b7657634e487b7160e01b600052602160045260246000fd5b8260208301529392505050565b600060208284031215611b9557600080fd5b8151610cdc816119a5565b6020808252602f908201527f476f7665726e616e63653a207375626a656374206973206e6f7420616c6c6f7760408201526e0656420746f20626f6f74737472617608c1b606082015260800190565b60008351611c01818460208801611773565b835190830190611c15818360208801611773565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c9a57611c9a611c70565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082611cc657611cc6611ca1565b500490565b600082821015611cdd57611cdd611c70565b500390565b600082611cf157611cf1611ca1565b500690565b60008219821115611d0957611d09611c70565b500190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611d579083018461179f565b9695505050505050565b600060208284031215611d7357600080fd5b8151610cdc8161173d56fea26469706673582212202e8b9b94d7199e02b295e333b534a5c8de0af4d4f07d70fb75a33378f91faeb064736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
afb12e5c8f4f6d5ea9a3c7ee77ef964b2cae95df8dc02113b3781f546e6132db000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e956
-----Decoded View---------------
Arg [0] : _hash (bytes32): 0xafb12e5c8f4f6d5ea9a3c7ee77ef964b2cae95df8dc02113b3781f546e6132db
Arg [1] : governanceAddress (address): 0xe609cD7cD8b7AD086a6f781f753641DA7aE0E956
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : afb12e5c8f4f6d5ea9a3c7ee77ef964b2cae95df8dc02113b3781f546e6132db
Arg [1] : 000000000000000000000000e609cd7cd8b7ad086a6f781f753641da7ae0e956
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.