More Info
Private Name Tags
ContractCreator
Latest 3 internal transactions
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
15855225 | 739 days ago | Contract Creation | 0 ETH | |||
15855225 | 739 days ago | Contract Creation | 0 ETH | |||
15855225 | 739 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Platform
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/security/Pausable.sol"; import "../@openzeppelin/contracts/access/Ownable.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ProjectFactory.sol"; import "../milestone/Milestone.sol"; import "../vault/IVault.sol"; import "../project/IProject.sol"; import "./IPlatform.sol"; contract Platform is ProjectFactory, IPlatform, /*Ownable, Pausable,*/ ReentrancyGuard { using ERC165Checker for address; //TODO platform state vars, allow team / vault vetting uint constant public MAX_PLATFORM_CUT_PROMILS = 20; //TODO verify max cut value IERC20 public platformToken; uint public platformCutPromils = 6; mapping(address => uint) public numPaymentTokensByTokenAddress; //-------- event PlatformFundTransferToOwner(address owner, uint toExtract); event TeamAddressApprovedStatusSet(address indexed teamWallet_, bool indexed approved_); event VaultAddressApprovedStatusSet(address indexed vaultAddress_, bool indexed approved_); event PlatformTokenChanged(address platformToken, address oldToken); event PlatformCutReceived(address indexed senderProject, uint value); event PlatformCutChanged(uint oldValPromils, uint platformCutPromils); error BadTeamDefinedVault(address projectVault_); error InsufficientFundsInContract( uint sumToExtract_, uint contractBalance ); error InvalidProjectAddress(address projectAddress); //--------- modifier openForAll() { _; } modifier onlyValidProject() { require( _validProjectAddress( msg.sender), "not a valid project"); _; } constructor( address projectTemplate_, address vaultTemplate_, address platformToken_) ProjectFactory( projectTemplate_, vaultTemplate_) { platformToken = IERC20(platformToken_); } /* * @title setPlatformToken * * @dev Allows platform owner to set the platform erc20 token * * NOTE: As part of the processing _new erc20 project tokens will be minted and transferred to the owner and * @event: PlatformTokenChanged */ function setPlatformToken(IERC20 newPlatformToken) external onlyOwner whenPaused { //@PUBFUNC // contract should be paused first IERC20 oldToken_ = platformToken; platformToken = newPlatformToken; emit PlatformTokenChanged(address(platformToken), address(oldToken_)); } /* * @title markVaultAsApproved * * @dev Set vault approval by platform to be used by future (only!) projects * * @event: VaultAddressApprovedStatusSet */ function markVaultAsApproved(address vaultAddress_, bool isApproved_) external onlyOwner { //@PUBFUNC approvedVaults[vaultAddress_] = isApproved_; emit VaultAddressApprovedStatusSet(vaultAddress_, isApproved_); } /* * @title transferFundsToPlatformOwner * * @dev Transfer payment-token funds from platform contract to platform owner * * @event: PlatformFundTransferToOwner */ function transferFundsToPlatformOwner(uint sumToExtract_, address tokenAddress_) external onlyOwner { //@PUBFUNC // @PROTECT: DoS, Re-entry _transferPaymntTokensFromPlatformTo( owner(), sumToExtract_, tokenAddress_); emit PlatformFundTransferToOwner(owner(), sumToExtract_); } function _transferPaymntTokensFromPlatformTo( address receiverAddr_, uint numPaymentTokens_, address tokenAddress_) private { require( numPaymentTokensByTokenAddress[ tokenAddress_] >= numPaymentTokens_, "not enough tokens in platform"); numPaymentTokensByTokenAddress[ tokenAddress_] -= numPaymentTokens_; bool ok = IERC20( tokenAddress_).transfer( receiverAddr_, numPaymentTokens_); require( ok, "Failed to transfer payment tokens"); } /* * @title setPlatformCut * * @dev Set platform cut (promils) after verifying it is <= MAX_PLATFORM_CUT_PROMILS * * @event: PlatformCutChanged */ function setPlatformCut(uint newPlatformCutPromils) external onlyOwner { //@PUBFUNC require( newPlatformCutPromils <= MAX_PLATFORM_CUT_PROMILS, "bad platform cut"); uint oldVal_ = platformCutPromils; platformCutPromils = newPlatformCutPromils; emit PlatformCutChanged( oldVal_, platformCutPromils); } /* * @title receive() * * @dev Allow a valid project (only) to pass payment-token to platform contract * * @event: PlatformCutReceived */ function onReceivePaymentTokens( address tokenAddress_, uint numTokensToPlatform_) external override onlyValidProject { //@PUBFUNC //@PTokTransfer numPaymentTokensByTokenAddress[ tokenAddress_] += numTokensToPlatform_; emit PlatformCutReceived( msg.sender, numTokensToPlatform_); } function getBlockTimestamp() external view returns(uint) { return block.timestamp; } function _getPlatformCutPromils() internal override view returns(uint) { return platformCutPromils; } function _isAnApprovedVault(address projectVault_) internal override view returns(bool) { return approvedVaults[address(projectVault_)]; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/access/Ownable.sol"; import "../project/PledgeEvent.sol"; interface IVault { function transferPToksToTeamWallet(uint sum_, uint platformCutPromils_, address platformAddr_) external returns(uint,uint); function transferPaymentTokensToPledger( address pledgerAddr_, uint sum_) external returns(uint); function increaseBalance( uint numPaymentTokens_) external; function vaultBalance() external view returns(uint); function totalAllPledgerDeposits() external view returns(uint); function changeOwnership( address project_) external; function getOwner() external view returns (address); function initialize( address owner_) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../@openzeppelin/contracts/access/Ownable.sol"; import "../project/IProject.sol"; interface IMintableOwnedERC20 is IERC20 { function mint(address to, uint256 amount) external ; function getOwner() external view returns (address); function changeOwnership( address dest) external; function setConnectedProject( IProject project_) external; function performInitialMint( uint numTokens) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "../@openzeppelin/contracts/security/Pausable.sol"; import "../@openzeppelin/contracts/access/Ownable.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "./IMintableOwnedERC20.sol"; import "../project/IProject.sol"; contract CommonGoodProjectToken is IMintableOwnedERC20, ERC20Burnable, ERC165Storage, Pausable, Ownable { IProject public project; modifier onlyOwnerOrProjectTeam() { require( msg.sender == owner() || msg.sender == project.getTeamWallet(), "token owner or team"); _; } //--- constructor(string memory name, string memory symbol) ERC20(name, symbol) { _registerInterface(type( IMintableOwnedERC20).interfaceId); } function performInitialMint( uint initialTokenSupply) external override onlyOwner { //@PUBFUNC @gilad mint( owner()/*tokenOwner*/, initialTokenSupply); } function setConnectedProject( IProject project_) external onlyOwner { //@PUBFUNC project = project_; } function pause() public onlyOwnerOrProjectTeam { //@PUBFUNC _pause(); } function unpause() public onlyOwnerOrProjectTeam { //@PUBFUNC _unpause(); } function getOwner() external override view returns (address) { return owner(); } function changeOwnership( address dest) external override { //@PUBFUNC return transferOwnership(dest); } function mint(address to, uint256 amount) public override onlyOwner { //@PUBFUNC _mint(to, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal whenNotPaused override { super._beforeTokenTransfer(from, to, amount); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; enum ProjectState { IN_PROGRESS, SUCCEEDED, FAILED }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../vault/IVault.sol"; import "../token/IMintableOwnedERC20.sol"; struct ProjectParams { // used to circumvent 'Stack too deep' error when creating a _new project address projectVault; address projectToken; address paymentToken; string tokenName; string tokenSymbol; uint minPledgedSum; uint initialTokenSupply; bytes32 cid; // ref to metadata }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../vault/IVault.sol"; import "../milestone/Milestone.sol"; import "../token/IMintableOwnedERC20.sol"; struct ProjectInitParams { address projectTeamWallet; IVault vault; Milestone[] milestones; IMintableOwnedERC20 projectToken; uint platformCutPromils; uint minPledgedSum; uint onChangeExitGracePeriod; uint pledgerGraceExitWaitTime; address paymentToken; bytes32 cid; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; struct PledgeEvent { //@STORAGEOPT uint32 date; uint sum; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../token/IMintableOwnedERC20.sol"; import "../vault/IVault.sol"; import "../milestone/Milestone.sol"; import "./ProjectState.sol"; import "./ProjectInitParams.sol"; interface IProject { function initialize( ProjectInitParams memory params_) external; function getOwner() external view returns(address); function getTeamWallet() external view returns(address); function getPaymentTokenAddress() external view returns(address); function mintProjectTokens( address receiptOwner_, uint numTokens_) external; function getProjectStartTime() external view returns(uint); function getProjectState() external view returns(ProjectState); function getVaultBalance() external view returns(uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/security/Pausable.sol"; import "../@openzeppelin/contracts/access/Ownable.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "../@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../@openzeppelin/contracts/proxy/Clones.sol"; import "../project/ProjectParams.sol"; import "../project/ProjectInitParams.sol"; import "../milestone/Milestone.sol"; import "../milestone/MilestoneResult.sol"; import "../token/CommonGoodProjectToken.sol"; import "../token/IMintableOwnedERC20.sol"; import "../vault/IVault.sol"; import "../project/IProject.sol"; import "../libs/Sanitizer.sol"; import "./BetaTestable.sol"; abstract contract ProjectFactory is BetaTestable, /*Ownable*/ Pausable { using Clones for address; address immutable public projectTemplate; address immutable public vaultTemplate; uint public onChangeExitGracePeriod = 7 days; uint public pledgerGraceExitWaitTime = 14 days; mapping(address => IProject) public addressToProject; mapping(address => bool) public isApprovedPaymentToken; address[] public projectAddresses; // all created projects - either in-progress or completed //-------- mapping(address => bool) public approvedVaults; uint public minNumMilestones; uint public maxNumMilestones; //---- modifier onlyIfCallingProjectSucceeded() { IProject callingProject_ = addressToProject[ msg.sender]; require( callingProject_.getProjectState() == ProjectState.SUCCEEDED, "project not succeeded"); _; } modifier legalNumberOfMilestones( Milestone[] memory milestones_) { require( milestones_.length >= minNumMilestones, "not enough milestones"); require( milestones_.length <= maxNumMilestones, "too many milestones"); _; } //---- constructor(address projectTemplate_, address vaultTemplate_) { projectTemplate = projectTemplate_; vaultTemplate = vaultTemplate_; minNumMilestones = 1; maxNumMilestones = 400; } event ApprovedPaymentTokenChanged( address indexed paymentToken, bool isLegal); event ProjectWasDeployed(uint indexed projectIndex, address indexed projectAddress, address indexed projectVault, uint numMilestones, address projectToken, string tokenName, string tokenSymbol, uint tokenSupply, uint onChangeExitGracePeriod, uint pledgerGraceExitWaitTime); event OnChangeExitGracePeriodChanged( uint newGracePeriod, uint oldGracePeriod); event PledgerGraceExitWaitTimeChanged( uint newValue, uint oldValue); event MliestoneLimitsChanged( uint new_minNumMilestones, uint indexed old_minNumMilestones, uint new_maxNumMilestones, uint indexed old_maxNumMilestones ); //--- error ExternallyProvidedProjectVaultMustBeOwnedByPlatform( address vault_, address vaultOwner_); error ExternallyProvidedProjectTokenMustBeOwnedByPlatform( address projectToken, address actualOwner_); error ProjectTokenMustBeIMintableERC20( address projectToken_); error NotAnApprovedVault(address projectVault_, address teamAddr); error MilestoneInitialResultMustBeUnresolved(uint milestoneIndex, MilestoneResult milestoneResult); error InvalidVault(address vault); //---- function _approvedPaymentToken(address paymentTokenAddr_) private view returns(bool) { return paymentTokenAddr_ != address(0) && isApprovedPaymentToken[ paymentTokenAddr_]; } /* * @title createProject() * * @dev create a _new project, must be called by an approved team wallet address with a complete * list fo milestones and parameters * Internally: will create project vault and a dedicated project token, unless externally provided * and will instantiate and deploy a project contract * * @precondition: externally provided vault and project-token, if any, must be platform owned * @postcondition: vault and project-token will be owned by project when exiting this function * * @event: ProjectWasDeployed */ //@DOC1 function createProject( ProjectParams memory params_, Milestone[] memory milestones_) external onlyValidBetaTester legalNumberOfMilestones( milestones_) whenNotPaused { //@PUBFUNC uint projectIndex_ = projectAddresses.length; address projectTeamWallet_ = msg.sender; require( _approvedPaymentToken( params_.paymentToken), "payment token not approved"); Sanitizer._sanitizeMilestones(milestones_, block.timestamp, minNumMilestones, maxNumMilestones); //@gilad externl vault initially owned by platform address => after owned by project if (params_.projectVault == address(0)) { // deploy a dedicated DefaultVault contract params_.projectVault = vaultTemplate.clone(); } else { _validateExternalVault( IVault(params_.projectVault)); } if (params_.projectToken == address(0)) { // deploy a dedicated CommonGoodProjectToken contract CommonGoodProjectToken newDeployedToken_ = new CommonGoodProjectToken(params_.tokenName, params_.tokenSymbol); params_.projectToken = address( newDeployedToken_); } else { _validateExternalToken( IMintableOwnedERC20(params_.projectToken)); } IMintableOwnedERC20 projToken_ = IMintableOwnedERC20(params_.projectToken); require( projToken_.getOwner() == address(this), "Project token must initially be owned by Platform"); //------------- IProject project_ = IProject( projectTemplate.clone()); IVault(params_.projectVault).initialize( address(project_)); require( IVault(params_.projectVault).getOwner() == address(project_), "Vault must be owned by project"); ProjectInitParams memory initParams_ = ProjectInitParams( { projectTeamWallet: projectTeamWallet_, vault: IVault(params_.projectVault), milestones: milestones_, projectToken: projToken_, platformCutPromils: _getPlatformCutPromils(), minPledgedSum: params_.minPledgedSum, onChangeExitGracePeriod: onChangeExitGracePeriod, pledgerGraceExitWaitTime: pledgerGraceExitWaitTime, paymentToken: params_.paymentToken, cid: params_.cid }); project_.initialize( initParams_); require( project_.getOwner() == projectTeamWallet_, "Project must be owned by team"); //------------- addressToProject[ address(project_)] = project_; projectAddresses.push( address(project_)); projToken_.setConnectedProject( project_); projToken_.performInitialMint( params_.initialTokenSupply); projToken_.changeOwnership( address(project_)); require( projToken_.getOwner() == address(project_), "Project token must be owned by Platform"); emit ProjectWasDeployed( projectIndex_, address(project_), params_.projectVault, milestones_.length, params_.projectToken, params_.tokenName, params_.tokenSymbol, params_.initialTokenSupply, onChangeExitGracePeriod, pledgerGraceExitWaitTime); } function _validateExternalToken( IMintableOwnedERC20 projectToken_) private view { if ( !ERC165Checker.supportsInterface( address(projectToken_), type(IMintableOwnedERC20).interfaceId)) { revert ProjectTokenMustBeIMintableERC20( address(projectToken_)); } address tokenOwner_ = projectToken_.getOwner(); if ( tokenOwner_ != address(this) && tokenOwner_ != address(0)) { revert ExternallyProvidedProjectTokenMustBeOwnedByPlatform( address( projectToken_), tokenOwner_); } } function _validateExternalVault( IVault vault_) private view { if ( !_isAnApprovedVault(address(vault_))) { revert NotAnApprovedVault( address(vault_), msg.sender); } if ( !_supportIVaultInterface(address(vault_))) { revert InvalidVault( address(vault_)); } address vaultOwner_ = IVault(vault_).getOwner(); if ( vaultOwner_ != address(this) && vaultOwner_ != address(0)) { revert ExternallyProvidedProjectVaultMustBeOwnedByPlatform( address(vault_), vaultOwner_); } } function _supportIVaultInterface(address projectVault_) private view returns(bool) { return ERC165Checker.supportsInterface( projectVault_, type(IVault).interfaceId); } function _validProjectAddress( address projectAddr_) internal view returns(bool) { return addressToProject[ projectAddr_].getProjectStartTime() > 0; } function setMilestoneMinMaxCounts( uint new_minNumMilestones, uint new_maxNumMilestones) external onlyOwner { //@PUBFUNC uint old_minNumMilestones = minNumMilestones; uint old_maxNumMilestones = maxNumMilestones; minNumMilestones = new_minNumMilestones; maxNumMilestones = new_maxNumMilestones; emit MliestoneLimitsChanged( minNumMilestones, old_minNumMilestones, maxNumMilestones, old_maxNumMilestones); } function approvePTok(address paymentTokenAddr_, bool isApproved_) external onlyOwner { //@PUBFUNC require( paymentTokenAddr_ != address(0), "bad payment token address"); isApprovedPaymentToken[ paymentTokenAddr_] = isApproved_; emit ApprovedPaymentTokenChanged( paymentTokenAddr_, isApproved_); } /* * @title setProjectChangeGracePeriod() * * @dev Sets the project grace period where pledgers are allowed to exit after project details change * Note that this change will only affect _new projects * * @event: OnChangeExitGracePeriodChanged */ function setProjectChangeGracePeriod(uint newGracePeriod) external onlyOwner { //@PUBFUNC // set grace period allowing pledgers to gracefully exit after project change uint oldGracePeriod_ = onChangeExitGracePeriod; onChangeExitGracePeriod = newGracePeriod; emit OnChangeExitGracePeriodChanged( onChangeExitGracePeriod, oldGracePeriod_); } /* * @title setPledgerWaitTimeBeforeGraceExit() * * @dev Sets the project pledger wait time between entering and being allowed to leave due to grace period * Note that this change will only affect _new projects * * @event: PledgerGraceExitWaitTimeChanged */ function setPledgerWaitTimeBeforeGraceExit(uint newWaitTime) external onlyOwner { //@PUBFUNC // will pnly take effect on future projects uint oldWaitTime_ = pledgerGraceExitWaitTime; pledgerGraceExitWaitTime = newWaitTime; emit PledgerGraceExitWaitTimeChanged( pledgerGraceExitWaitTime, oldWaitTime_); } function numProjects() external view returns(uint) { return projectAddresses.length; } //------------ function _getPlatformCutPromils() internal virtual view returns(uint); function _isAnApprovedVault(address vault) internal virtual view returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; interface IPlatform { function onReceivePaymentTokens( address paymentTokenAddress_, uint platformCut_) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../@openzeppelin/contracts/access/Ownable.sol"; abstract contract BetaTestable is Ownable { bool public inBetaMode = true; //TODO mapping( address => bool) public isBetaTester; event BetaModeChanged( bool indexed inBetaMode, bool indexed oldBetaMode); event SetBetaTester( address indexed testerAddress, bool indexed isBetaTester); modifier onlyValidBetaTester() { require( _isValidBetaTester(), "not a valid beta tester"); _; } function _isValidBetaTester() private view returns(bool) { if( !inBetaMode) { return true; // not in beta mode - allow all in } return isBetaTester[ msg.sender]; } /* * @title setBetaMode() * * @dev Set beta mode flag. When in beta mode only beta users are allowed as project teams * * @event: BetaModeChanged */ function setBetaMode(bool inBetaMode_) external onlyOwner { //@PUBFUNC bool oldMode = inBetaMode; inBetaMode = inBetaMode_; emit BetaModeChanged( inBetaMode, oldMode); } /* * @title setBetaTester() * * @dev Set a beta tester boolean flag. This call allows both approving and disapproving a beta tester address * * @event: SetBetaTester */ function setBetaTester(address testerAddress, bool isBetaTester_) external onlyOwner { //@PUBFUNC //require( inBetaMode); -- not needed isBetaTester[ testerAddress] = isBetaTester_; emit SetBetaTester( testerAddress, isBetaTester_); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; enum MilestoneResult { UNRESOLVED, SUCCEEDED, FAILED }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; struct MilestoneApprover { //off-chain: oracle, judge.. address externalApprover; //on-chain uint32 targetNumPledgers; uint fundingPTokTarget; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "./MilestoneApprover.sol"; import "./MilestoneResult.sol"; import "../vault/IVault.sol"; struct Milestone { MilestoneApprover milestoneApprover; MilestoneResult result; uint32 dueDate; int32 prereqInd; uint pTokValue; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../milestone/Milestone.sol"; import "../milestone/MilestoneApprover.sol"; import "../milestone/MilestoneResult.sol"; /* TODO: hhhh tokens: https://www.youtube.com/watch?v=gc7e90MHvl8 find erc20 asset price via chainlink callback or API: https://blog.chain.link/fetch-current-crypto-price-data-solidity/ https://www.quora.com/How-do-I-get-the-price-of-an-ERC20-token-from-a-solidity-smart-contract https://blog.logrocket.com/create-oracle-ethereum-smart-contract/ https://noahliechti.hashnode.dev/an-effective-way-to-build-your-own-oracle-with-solidity use timelock? truffle network switcher deploy in testnet -- rinkbey a couple of basic tests deploy 2 ms + 3 bidders try get eth - fail try get tokens fail success try get eth - fail try get tokens fail success try get eth - success try get tokens success --- IProject IPlatform + supprit-itf clone contract for existing template address https://www.youtube.com/watch?v=LZ3XPhV7I1Q openz token types go over openzeppelin relevant utils refund nft receipt from any1 (not only orig ownner); avoid reuse (burn??) refund PTok for leaving pledgr -- grace/failure allow prj erc20 frorpldgr on prj success inject vault and rpjtoken rather than deploy write some tests create nft when transfer platform token?? deal with nft cashing deal with completed_indexes list after change -- maybe just remove it? problem with updating project --how keep info on completedList and pundedStartingIndex who holds the erc20 project-token funds of this token? should pre-invoke to make sure has funds? ------- Guice - box bonding curvse : A bonding curve describes the relationship between the price and supply of an asset what is market-makers? startProj, endProj, pledGer.enterTime // project.projectStartTime, project.projectEndTime compensate with erc20 only if proj success maybe receipt == erc721?; reserved sum === by frequency calculation; */ library Sanitizer { //@gilad: allow configuration? uint constant public MIN_MILESTONE_INTERVAL = 1 days; uint constant public MAX_MILESTONE_INTERVAL = 365 days; error IllegalMilestoneDueDate( uint index, uint32 dueDate, uint timestamp); error NoMilestoneApproverWasSet(uint index); error AmbiguousMilestoneApprover(uint index, address externalApprover, uint fundingPTokTarget, uint numPledgers); function _sanitizeMilestones( Milestone[] memory milestones_, uint now_, uint minNumMilestones_, uint maxNumMilestones_) internal pure { // assuming low milestone count require( minNumMilestones_ == 0 || milestones_.length >= minNumMilestones_, "not enough milestones"); require( maxNumMilestones_ == 0 || milestones_.length <= maxNumMilestones_, "too many milestones"); for (uint i = 0; i < milestones_.length; i++) { _validateDueDate(i, milestones_[i].dueDate, now_); _validateApprover(i, milestones_[i].milestoneApprover); milestones_[i].result = MilestoneResult.UNRESOLVED; } } function _validateDueDate( uint index, uint32 dueDate, uint now_) private pure { if ( (dueDate < now_ + MIN_MILESTONE_INTERVAL) || (dueDate > now_ + MAX_MILESTONE_INTERVAL) ) { revert IllegalMilestoneDueDate(index, dueDate, now_); } } function _validateApprover(uint index, MilestoneApprover memory approver_) private pure { bool approverIsSet_ = (approver_.externalApprover != address(0) || approver_.fundingPTokTarget > 0 || approver_.targetNumPledgers > 0); if ( !approverIsSet_) { revert NoMilestoneApproverWasSet(index); } bool extApproverUnique = (approver_.externalApprover == address(0) || (approver_.fundingPTokTarget == 0 && approver_.targetNumPledgers == 0)); bool fundingTargetUnique = (approver_.fundingPTokTarget == 0 || (approver_.externalApprover == address(0) && approver_.targetNumPledgers == 0)); bool numPledgersUnique = (approver_.targetNumPledgers == 0 || (approver_.externalApprover == address(0) && approver_.fundingPTokTarget == 0)); if ( !extApproverUnique || !fundingTargetUnique || !numPledgersUnique) { revert AmbiguousMilestoneApprover(index, approver_.externalApprover, approver_.fundingPTokTarget, approver_.targetNumPledgers); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol) pragma solidity ^0.8.0; import "./ERC165.sol"; /** * @dev Storage based implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ abstract contract ERC165Storage is ERC165 { /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedInterfaces; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId]; } /** * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See {IERC165-supportsInterface}. * * Requirements: * * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`). */ function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface, */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return _supportsERC165Interface(account, type(IERC165).interfaceId) && !_supportsERC165Interface(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && _supportsERC165Interface(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in _interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!_supportsERC165Interface(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) { // prepare call bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); // perform static call bool success; uint256 returnSize; uint256 returnValue; assembly { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00) } return success && returnSize >= 0x20 && returnValue > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 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 // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { _spendAllowance(account, _msgSender(), amount); _burn(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens 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 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 1 }, "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":"address","name":"projectTemplate_","type":"address"},{"internalType":"address","name":"vaultTemplate_","type":"address"},{"internalType":"address","name":"platformToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"externalApprover","type":"address"},{"internalType":"uint256","name":"fundingPTokTarget","type":"uint256"},{"internalType":"uint256","name":"numPledgers","type":"uint256"}],"name":"AmbiguousMilestoneApprover","type":"error"},{"inputs":[{"internalType":"address","name":"projectVault_","type":"address"}],"name":"BadTeamDefinedVault","type":"error"},{"inputs":[{"internalType":"address","name":"projectToken","type":"address"},{"internalType":"address","name":"actualOwner_","type":"address"}],"name":"ExternallyProvidedProjectTokenMustBeOwnedByPlatform","type":"error"},{"inputs":[{"internalType":"address","name":"vault_","type":"address"},{"internalType":"address","name":"vaultOwner_","type":"address"}],"name":"ExternallyProvidedProjectVaultMustBeOwnedByPlatform","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint32","name":"dueDate","type":"uint32"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"IllegalMilestoneDueDate","type":"error"},{"inputs":[{"internalType":"uint256","name":"sumToExtract_","type":"uint256"},{"internalType":"uint256","name":"contractBalance","type":"uint256"}],"name":"InsufficientFundsInContract","type":"error"},{"inputs":[{"internalType":"address","name":"projectAddress","type":"address"}],"name":"InvalidProjectAddress","type":"error"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"InvalidVault","type":"error"},{"inputs":[{"internalType":"uint256","name":"milestoneIndex","type":"uint256"},{"internalType":"enum MilestoneResult","name":"milestoneResult","type":"uint8"}],"name":"MilestoneInitialResultMustBeUnresolved","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"NoMilestoneApproverWasSet","type":"error"},{"inputs":[{"internalType":"address","name":"projectVault_","type":"address"},{"internalType":"address","name":"teamAddr","type":"address"}],"name":"NotAnApprovedVault","type":"error"},{"inputs":[{"internalType":"address","name":"projectToken_","type":"address"}],"name":"ProjectTokenMustBeIMintableERC20","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"paymentToken","type":"address"},{"indexed":false,"internalType":"bool","name":"isLegal","type":"bool"}],"name":"ApprovedPaymentTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"inBetaMode","type":"bool"},{"indexed":true,"internalType":"bool","name":"oldBetaMode","type":"bool"}],"name":"BetaModeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_minNumMilestones","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"old_minNumMilestones","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"new_maxNumMilestones","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"old_maxNumMilestones","type":"uint256"}],"name":"MliestoneLimitsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newGracePeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldGracePeriod","type":"uint256"}],"name":"OnChangeExitGracePeriodChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValPromils","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"platformCutPromils","type":"uint256"}],"name":"PlatformCutChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"senderProject","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"PlatformCutReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"toExtract","type":"uint256"}],"name":"PlatformFundTransferToOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"platformToken","type":"address"},{"indexed":false,"internalType":"address","name":"oldToken","type":"address"}],"name":"PlatformTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"}],"name":"PledgerGraceExitWaitTimeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"projectAddress","type":"address"},{"indexed":true,"internalType":"address","name":"projectVault","type":"address"},{"indexed":false,"internalType":"uint256","name":"numMilestones","type":"uint256"},{"indexed":false,"internalType":"address","name":"projectToken","type":"address"},{"indexed":false,"internalType":"string","name":"tokenName","type":"string"},{"indexed":false,"internalType":"string","name":"tokenSymbol","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"onChangeExitGracePeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pledgerGraceExitWaitTime","type":"uint256"}],"name":"ProjectWasDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"testerAddress","type":"address"},{"indexed":true,"internalType":"bool","name":"isBetaTester","type":"bool"}],"name":"SetBetaTester","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"teamWallet_","type":"address"},{"indexed":true,"internalType":"bool","name":"approved_","type":"bool"}],"name":"TeamAddressApprovedStatusSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vaultAddress_","type":"address"},{"indexed":true,"internalType":"bool","name":"approved_","type":"bool"}],"name":"VaultAddressApprovedStatusSet","type":"event"},{"inputs":[],"name":"MAX_PLATFORM_CUT_PROMILS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressToProject","outputs":[{"internalType":"contract IProject","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentTokenAddr_","type":"address"},{"internalType":"bool","name":"isApproved_","type":"bool"}],"name":"approvePTok","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedVaults","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"projectVault","type":"address"},{"internalType":"address","name":"projectToken","type":"address"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"string","name":"tokenName","type":"string"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"minPledgedSum","type":"uint256"},{"internalType":"uint256","name":"initialTokenSupply","type":"uint256"},{"internalType":"bytes32","name":"cid","type":"bytes32"}],"internalType":"struct ProjectParams","name":"params_","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"externalApprover","type":"address"},{"internalType":"uint32","name":"targetNumPledgers","type":"uint32"},{"internalType":"uint256","name":"fundingPTokTarget","type":"uint256"}],"internalType":"struct MilestoneApprover","name":"milestoneApprover","type":"tuple"},{"internalType":"enum MilestoneResult","name":"result","type":"uint8"},{"internalType":"uint32","name":"dueDate","type":"uint32"},{"internalType":"int32","name":"prereqInd","type":"int32"},{"internalType":"uint256","name":"pTokValue","type":"uint256"}],"internalType":"struct Milestone[]","name":"milestones_","type":"tuple[]"}],"name":"createProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inBetaMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isApprovedPaymentToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isBetaTester","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vaultAddress_","type":"address"},{"internalType":"bool","name":"isApproved_","type":"bool"}],"name":"markVaultAsApproved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxNumMilestones","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minNumMilestones","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numPaymentTokensByTokenAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numProjects","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onChangeExitGracePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint256","name":"numTokensToPlatform_","type":"uint256"}],"name":"onReceivePaymentTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformCutPromils","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pledgerGraceExitWaitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"projectAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"inBetaMode_","type":"bool"}],"name":"setBetaMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"testerAddress","type":"address"},{"internalType":"bool","name":"isBetaTester_","type":"bool"}],"name":"setBetaTester","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"new_minNumMilestones","type":"uint256"},{"internalType":"uint256","name":"new_maxNumMilestones","type":"uint256"}],"name":"setMilestoneMinMaxCounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPlatformCutPromils","type":"uint256"}],"name":"setPlatformCut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"newPlatformToken","type":"address"}],"name":"setPlatformToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newWaitTime","type":"uint256"}],"name":"setPledgerWaitTimeBeforeGraceExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newGracePeriod","type":"uint256"}],"name":"setProjectChangeGracePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"sumToExtract_","type":"uint256"},{"internalType":"address","name":"tokenAddress_","type":"address"}],"name":"transferFundsToPlatformOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c06040526000805460ff60a01b1916600160a01b17905562093a80600355621275006004556006600d553480156200003757600080fd5b5060405162003e7438038062003e748339810160408190526200005a9162000122565b82826200006733620000b5565b6002805460ff191690556001600160a01b03918216608052811660a05260016009819055610190600a55600b55600c80546001600160a01b03191692909116919091179055506200016c9050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200011d57600080fd5b919050565b6000806000606084860312156200013857600080fd5b620001438462000105565b9250620001536020850162000105565b9150620001636040850162000105565b90509250925092565b60805160a051613cd4620001a06000396000818161021f015261085501526000818161038e0152610a0f0152613cd46000f3fe60806040523480156200001157600080fd5b5060043610620001ba5760003560e01c80630255a03b14620001bf5780630559815914620001d85780630598c68b14620002025780630b1e423814620002195780630b8f3ee614620002505780631286ba4d14620002695780631685f29714620002805780631af2be9f1462000297578063265d1d5814620002a1578063279b136614620002ab5780635a067baa14620002c25780635bc4675c14620002cb5780635c975abb14620002f75780636eb395351462000303578063715018a61462000329578063770366841462000333578063796b89b9146200033d5780638671443a146200034457806388d5e3ce146200035b5780638da5cb5b146200037e57806395c829751462000388578063a3839d3f14620003b0578063a3d5a21f14620003d6578063a5d65e9314620003ed578063af7a060c1462000404578063bad141b8146200042a578063be733d3c1462000434578063c33857de146200044b578063cc13fd3b1462000454578063d1b812cd146200046b578063d6341862146200047f578063daeb39b51462000496578063f2fde38b14620004ad578063feac994214620004c4575b600080fd5b620001d6620001d036600462001dd7565b620004db565b005b600054620001ed90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b620001d66200021336600462001e04565b62000550565b620002417f000000000000000000000000000000000000000000000000000000000000000081565b604051620001f9919062001e40565b6200025a600a5481565b604051908152602001620001f9565b620001d66200027a36600462001e54565b6200060c565b620001d66200029136600462001e6e565b62000652565b6200025a60095481565b6200025a600d5481565b620001d6620002bc36600462001eb0565b620006ae565b6007546200025a565b62000241620002dc36600462001dd7565b6005602052600090815260409020546001600160a01b031681565b60025460ff16620001ed565b620001ed6200031436600462001dd7565b60016020526000908152604090205460ff1681565b620001d66200070c565b6200025a60045481565b426200025a565b620001d66200035536600462002182565b62000724565b6200025a6200036c36600462001dd7565b600e6020526000908152604090205481565b6200024162001000565b620002417f000000000000000000000000000000000000000000000000000000000000000081565b620001ed620003c136600462001dd7565b60066020526000908152604090205460ff1681565b620001d6620003e736600462001eb0565b6200100f565b620001d6620003fe36600462001eb0565b620010c6565b620001ed6200041536600462001dd7565b60086020526000908152604090205460ff1681565b6200025a60035481565b620001d6620004453660046200229f565b62001124565b6200025a601481565b620002416200046536600462001e54565b6200118b565b600c5462000241906001600160a01b031681565b620001d66200049036600462001e54565b620011b6565b620001d6620004a736600462001e54565b620011fc565b620001d6620004be36600462001dd7565b62001288565b620001d6620004d5366004620022bf565b62001307565b620004e562001369565b620004ef620013cc565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116917f8e68ed0ed26d2aa6bca301133b429d046e7add45cb19160e3dcedd714271ddaa916200054491908490620022e2565b60405180910390a15050565b6200055b3362001417565b620005a35760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818481d985b1a59081c1c9bda9958dd606a1b60448201526064015b60405180910390fd5b6001600160a01b0382166000908152600e602052604081208054839290620005cd90849062002312565b909155505060405181815233907f338c545a8e5e070c15914aca67d4bea288f89df50423c4d0a30d7b7820ab20d4906020015b60405180910390a25050565b6200061662001369565b60048054908290556040517f30e4f9c7f8a1af88be510044d9c65e449ff53fd41daf3beab41c740c2cc9b1219062000544908490849062002328565b6200065c62001369565b620006726200066a62001000565b83836200149d565b7ffcee77aee7d834c3616e216f4b062dbcec802e05a967a6f76cd63a57654960436200069d62001000565b836040516200054492919062002336565b620006b862001369565b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917fcb27316e4c294dbd6259292315713cba48b6d131e45979befc3657958cc5baf791a35050565b6200071662001369565b62000722600062001610565b565b6200072e62001660565b620007765760405162461bcd60e51b81526020600482015260176024820152763737ba1030903b30b634b2103132ba30903a32b9ba32b960491b60448201526064016200059a565b80600954815110156200079d5760405162461bcd60e51b81526004016200059a906200234f565b600a5481511115620007c35760405162461bcd60e51b81526004016200059a906200237e565b620007cd62001690565b60075460408401513390620007e290620016d8565b6200082d5760405162461bcd60e51b815260206004820152601a6024820152791c185e5b595b9d081d1bdad95b881b9bdd08185c1c1c9bdd995960321b60448201526064016200059a565b6200083f8442600954600a5462001711565b84516001600160a01b03166200089457620008837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200183f565b6001600160a01b03168552620008a1565b8451620008a190620018de565b60208501516001600160a01b03166200090e57600085606001518660800151604051620008ce9062001db3565b620008db929190620023f3565b604051809103906000f080158015620008f8573d6000803e3d6000fd5b506001600160a01b03166020870152506200091d565b6200091d8560200151620019ff565b600085602001519050306001600160a01b0316816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000995919062002425565b6001600160a01b03161462000a075760405162461bcd60e51b815260206004820152603160248201527f50726f6a65637420746f6b656e206d75737420696e697469616c6c79206265206044820152706f776e656420627920506c6174666f726d60781b60648201526084016200059a565b600062000a3d7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200183f565b875160405163189acdbd60e31b81529192506001600160a01b03169063c4d66de89062000a6f90849060040162001e40565b600060405180830381600087803b15801562000a8a57600080fd5b505af115801562000a9f573d6000803e3d6000fd5b50505050806001600160a01b031687600001516001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000af0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b16919062002425565b6001600160a01b03161462000b6e5760405162461bcd60e51b815260206004820152601e60248201527f5661756c74206d757374206265206f776e65642062792070726f6a656374000060448201526064016200059a565b6000604051806101400160405280856001600160a01b0316815260200189600001516001600160a01b03168152602001888152602001846001600160a01b0316815260200162000bbd600d5490565b81526020018960a0015181526020016003548152602001600454815260200189604001516001600160a01b031681526020018960e001518152509050816001600160a01b031663ed60844e826040518263ffffffff1660e01b815260040162000c27919062002525565b600060405180830381600087803b15801562000c4257600080fd5b505af115801562000c57573d6000803e3d6000fd5b50505050836001600160a01b0316826001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ca4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cca919062002425565b6001600160a01b03161462000d225760405162461bcd60e51b815260206004820152601d60248201527f50726f6a656374206d757374206265206f776e6564206279207465616d00000060448201526064016200059a565b6001600160a01b0380831660008181526005602052604080822080546001600160a01b031990811685179091556007805460018101825593527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909201805490921690921790555163c3856dd560e01b81529084169063c3856dd59062000dae90859060040162001e40565b600060405180830381600087803b15801562000dc957600080fd5b505af115801562000dde573d6000803e3d6000fd5b50505060c08901516040516306efd0ab60e11b81526001600160a01b0386169250630ddfa1569162000e169160040190815260200190565b600060405180830381600087803b15801562000e3157600080fd5b505af115801562000e46573d6000803e3d6000fd5b505060405163157a618f60e11b81526001600160a01b0386169250632af4c31e915062000e7890859060040162001e40565b600060405180830381600087803b15801562000e9357600080fd5b505af115801562000ea8573d6000803e3d6000fd5b50505050816001600160a01b0316836001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ef5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f1b919062002425565b6001600160a01b03161462000f835760405162461bcd60e51b815260206004820152602760248201527f50726f6a65637420746f6b656e206d757374206265206f776e656420627920506044820152666c6174666f726d60c81b60648201526084016200059a565b87600001516001600160a01b0316826001600160a01b0316867f768ca9a2690bb4dcdc8a76e37a297710292c25ea0d2c6a19f1a60a667ce486bc8a518c602001518d606001518e608001518f60c0015160035460045460405162000fee9796959493929190620025d9565b60405180910390a45050505050505050565b6000546001600160a01b031690565b6200101962001369565b6001600160a01b0382166200106d5760405162461bcd60e51b8152602060048201526019602482015278626164207061796d656e7420746f6b656e206164647265737360381b60448201526064016200059a565b6001600160a01b038216600081815260066020908152604091829020805460ff191685151590811790915591519182527f913eb45a6b9c0eef201a0ca08ba90ef347aa5330972c612123a01db6aef5adc3910162000600565b620010d062001369565b6001600160a01b038216600081815260016020526040808220805460ff191685151590811790915590519092917f124a4100d72918c516edd5da571e325eceacab225ab7b85c8496d70c638d4f5091a35050565b6200112e62001369565b60008054821515600160a01b90810260ff60a01b1983161780845560405160ff9383900484169485151594939092049092161515917f02e159cf7954f1c380c45a4213433dd148960788d130a7a9f6779391158f4edf9190a35050565b600781815481106200119c57600080fd5b6000918252602090912001546001600160a01b0316905081565b620011c062001369565b60038054908290556040517f360d4ea951ccea990cedc596e311eec2dd390cb74348c6c754f5bb0cf02acf659062000544908490849062002328565b6200120662001369565b60148111156200124c5760405162461bcd60e51b815260206004820152601060248201526f189859081c1b185d199bdc9b4818dd5d60821b60448201526064016200059a565b600d8054908290556040517f307c6d665b2784039bcbc7a05ef46d165292101a54bd1fe037036f9ea96e7b699062000544908390859062002328565b6200129262001369565b6001600160a01b038116620012f95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200059a565b620013048162001610565b50565b6200131162001369565b60098054600a805492859055839055604051909190819083907f1855cffd4cf3e4971fe04a2b5bf4826b4dd9dd64c752058388c6cc0fbb66c196906200135b908890889062002328565b60405180910390a350505050565b336200137462001000565b6001600160a01b031614620007225760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200059a565b60025460ff16620007225760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016200059a565b6001600160a01b038082166000908152600560209081526040808320548151637a1c878160e11b815291519394859491169263f4390f0292600480820193918290030181865afa15801562001470573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001496919062002639565b1192915050565b6001600160a01b0381166000908152600e6020526040902054821115620015075760405162461bcd60e51b815260206004820152601d60248201527f6e6f7420656e6f75676820746f6b656e7320696e20706c6174666f726d00000060448201526064016200059a565b6001600160a01b0381166000908152600e6020526040812080548492906200153190849062002653565b909155505060405163a9059cbb60e01b81526000906001600160a01b0383169063a9059cbb9062001569908790879060040162002336565b6020604051808303816000875af115801562001589573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015af919062002669565b9050806200160a5760405162461bcd60e51b815260206004820152602160248201527f4661696c656420746f207472616e73666572207061796d656e7420746f6b656e6044820152607360f81b60648201526084016200059a565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008054600160a01b900460ff16620016795750600190565b503360009081526001602052604090205460ff1690565b60025460ff1615620007225760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016200059a565b60006001600160a01b038216158015906200170b57506001600160a01b03821660009081526006602052604090205460ff165b92915050565b81158062001720575081845110155b6200173f5760405162461bcd60e51b81526004016200059a906200234f565b8015806200174e575080845111155b6200176d5760405162461bcd60e51b81526004016200059a906200237e565b60005b84518110156200183857620017a78186838151811062001794576200179462002689565b6020026020010151604001518662001ae3565b620017d381868381518110620017c157620017c162002689565b60200260200101516000015162001b55565b6000858281518110620017ea57620017ea62002689565b60200260200101516020019060028111156200180a576200180a62002445565b9081600281111562001820576200182062002445565b905250806200182f816200269f565b91505062001770565b5050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116620018d95760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016200059a565b919050565b6001600160a01b03811660009081526008602052604090205460ff166200191e578033604051637b4fa80960e11b81526004016200059a929190620022e2565b620019298162001cb8565b6200194b57806040516357b980d760e11b81526004016200059a919062001e40565b6000816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200198c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620019b2919062002425565b90506001600160a01b0381163014801590620019d657506001600160a01b03811615155b15620019fb578181604051631d4df08f60e21b81526004016200059a929190620022e2565b5050565b62001a1281630b54881b60e21b62001cc8565b62001a335780604051628fbd1760e41b81526004016200059a919062001e40565b6000816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001a74573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001a9a919062002425565b90506001600160a01b038116301480159062001abe57506001600160a01b03811615155b15620019fb578181604051631e290b4d60e21b81526004016200059a929190620022e2565b62001af2620151808262002312565b8263ffffffff16108062001b1a575062001b116301e133808262002312565b8263ffffffff16115b1562001b5057604051634753f59560e01b81526004810184905263ffffffff83166024820152604481018290526064016200059a565b505050565b80516000906001600160a01b031615158062001b75575060008260400151115b8062001b8b57506000826020015163ffffffff16115b90508062001bb0576040516328eeae7960e11b8152600481018490526024016200059a565b81516000906001600160a01b0316158062001be15750604083015115801562001be15750602083015163ffffffff16155b9050600083604001516000148062001c15575083516001600160a01b031615801562001c155750602084015163ffffffff16155b90506000846020015163ffffffff166000148062001c49575084516001600160a01b031615801562001c4957506040850151155b905082158062001c57575081155b8062001c61575080155b1562001cb0578451604080870151602088015191516307ee0dc560e41b8152600481018a90526001600160a01b039093166024840152604483015263ffffffff1660648201526084016200059a565b505050505050565b60006200170b8263bfe3580d60e01b5b600062001cd58362001cf0565b801562001ce9575062001ce9838362001d28565b9392505050565b600062001d05826301ffc9a760e01b62001d28565b80156200170b575062001d21826001600160e01b031962001d28565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d9150600051905082801562001d9b575060208210155b801562001da85750600081115b979650505050505050565b6115e380620026bc83390190565b6001600160a01b03811681146200130457600080fd5b60006020828403121562001dea57600080fd5b813562001ce98162001dc1565b8035620018d98162001dc1565b6000806040838503121562001e1857600080fd5b823562001e258162001dc1565b946020939093013593505050565b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b60006020828403121562001e6757600080fd5b5035919050565b6000806040838503121562001e8257600080fd5b82359150602083013562001e968162001dc1565b809150509250929050565b80151581146200130457600080fd5b6000806040838503121562001ec457600080fd5b823562001ed18162001dc1565b9150602083013562001e968162001ea1565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b60405290565b604051606081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b60405161010081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b604051601f8201601f191681016001600160401b038111828210171562001f9a5762001f9a62001ee3565b604052919050565b600082601f83011262001fb457600080fd5b81356001600160401b0381111562001fd05762001fd062001ee3565b62001fe5601f8201601f191660200162001f6f565b81815284602083860101111562001ffb57600080fd5b816020850160208301376000918101602001919091529392505050565b803563ffffffff81168114620018d957600080fd5b803560038110620018d957600080fd5b8035600381900b8114620018d957600080fd5b600082601f8301126200206257600080fd5b813560206001600160401b0382111562002080576200208062001ee3565b62002090818360051b0162001f6f565b82815260e09283028501820192828201919087851115620020b057600080fd5b8387015b85811015620021755780890382811215620020cf5760008081fd5b620020d962001ef9565b606080831215620020ea5760008081fd5b620020f462001f24565b92508335620021038162001dc1565b83526200211284890162002018565b8884015260408085013581850152838352620021308286016200202d565b89840152608093506200214584860162002018565b908301526200215760a085016200203d565b9082015260c0830135918101919091528452928401928101620020b4565b5090979650505050505050565b600080604083850312156200219657600080fd5b82356001600160401b0380821115620021ae57600080fd5b908401906101008287031215620021c457600080fd5b620021ce62001f49565b620021d98362001df7565b8152620021e96020840162001df7565b6020820152620021fc6040840162001df7565b60408201526060830135828111156200221457600080fd5b620022228882860162001fa2565b6060830152506080830135828111156200223b57600080fd5b620022498882860162001fa2565b60808301525060a083013560a082015260c083013560c082015260e083013560e08201528094505060208501359150808211156200228657600080fd5b50620022958582860162002050565b9150509250929050565b600060208284031215620022b257600080fd5b813562001ce98162001ea1565b60008060408385031215620022d357600080fd5b50508035926020909101359150565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052601160045260246000fd5b808201808211156200170b576200170b620022fc565b918252602082015260400190565b6001600160a01b03929092168252602082015260400190565b6020808252601590820152746e6f7420656e6f756768206d696c6573746f6e657360581b604082015260600190565b602080825260139082015272746f6f206d616e79206d696c6573746f6e657360681b604082015260600190565b6000815180845260005b81811015620023d357602081850181015186830182015201620023b5565b506000602082860101526020601f19601f83011685010191505092915050565b604081526000620024086040830185620023ab565b82810360208401526200241c8185620023ab565b95945050505050565b6000602082840312156200243857600080fd5b815162001ce98162001dc1565b634e487b7160e01b600052602160045260246000fd5b60008151808452602080850194508084016000805b8481101562002519578251805180516001600160a01b03168a528581015163ffffffff16868b0152604090810151818b01528582015190606060038310620024c657634e487b7160e01b86526021600452602486fd5b8b81019290925282015190608090620024e6828d018463ffffffff169052565b8301519150620024fb60a08c018360030b9052565b919091015160c08a01525060e0909701969183019160010162002470565b50959695505050505050565b602081526200253960208201835162001e33565b600060208301516200254f604084018262001e33565b5060408301516101408060608501526200256e6101608501836200245b565b9150606085015162002584608086018262001e33565b50608085015160a085015260a085015160c085015260c085015160e085015260e0850151610100818187015280870151915050610120620025c88187018362001e33565b959095015193019290925250919050565b8781526001600160a01b038716602082015260e0604082018190526000906200260590830188620023ab565b8281036060840152620026198188620023ab565b6080840196909652505060a081019290925260c090910152949350505050565b6000602082840312156200264c57600080fd5b5051919050565b818103818111156200170b576200170b620022fc565b6000602082840312156200267c57600080fd5b815162001ce98162001ea1565b634e487b7160e01b600052603260045260246000fd5b600060018201620026b457620026b4620022fc565b506001019056fe60806040523480156200001157600080fd5b50604051620015e3380380620015e3833981016040819052620000349162000228565b8181600362000044838262000321565b50600462000053828262000321565b50506006805460ff19169055506200006b3362000085565b6200007d630b54881b60e21b620000df565b5050620003ed565b600680546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160e01b031980821690036200013e5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152600560205260409020805460ff19166001179055565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200018b57600080fd5b81516001600160401b0380821115620001a857620001a862000163565b604051601f8301601f19908116603f01168101908282118183101715620001d357620001d362000163565b81604052838152602092508683858801011115620001f057600080fd5b600091505b83821015620002145785820183015181830184015290820190620001f5565b600093810190920192909252949350505050565b600080604083850312156200023c57600080fd5b82516001600160401b03808211156200025457600080fd5b620002628683870162000179565b935060208501519150808211156200027957600080fd5b50620002888582860162000179565b9150509250929050565b600181811c90821680620002a757607f821691505b602082108103620002c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200031c57600081815260208120601f850160051c81016020861015620002f75750805b601f850160051c820191505b81811015620003185782815560010162000303565b5050505b505050565b81516001600160401b038111156200033d576200033d62000163565b62000355816200034e845462000292565b84620002ce565b602080601f8311600181146200038d5760008415620003745750858301515b600019600386901b1c1916600185901b17855562000318565b600085815260208120601f198616915b82811015620003be578886015182559484019460019091019084016200039d565b5085821015620003dd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6111e680620003fd6000396000f3fe608060405234801561001057600080fd5b506004361061013e5760003560e01c806301ffc9a71461014357806306fdde031461016b578063095ea7b3146101805780630ddfa1561461019357806318160ddd146101a857806323b872dd146101ba5780632af4c31e146101cd578063313ce567146101e057806339509351146101ef5780633f4ba83a1461020257806340c10f191461020a57806342966c681461021d5780635c975abb1461023057806370a082311461023b578063715018a61461026457806379cc67901461026c5780638456cb591461027f578063893d20e8146102875780638da5cb5b1461029c57806395d89b41146102a4578063a457c2d7146102ac578063a9059cbb146102bf578063c3856dd5146102d2578063dd62ed3e146102e5578063f2fde38b146102f8578063f60ca60d1461030b575b600080fd5b610156610151366004610f4c565b61031e565b60405190151581526020015b60405180910390f35b61017361035e565b6040516101629190610f7d565b61015661018e366004610fe0565b6103f0565b6101a66101a136600461100c565b610408565b005b6002545b604051908152602001610162565b6101566101c8366004611025565b610424565b6101a66101db366004611066565b610448565b60405160128152602001610162565b6101566101fd366004610fe0565b610451565b6101a6610473565b6101a6610218366004610fe0565b610550565b6101a661022b36600461100c565b610566565b60065460ff16610156565b6101ac610249366004611066565b6001600160a01b031660009081526020819052604090205490565b6101a6610570565b6101a661027a366004610fe0565b610582565b6101a6610597565b61028f610669565b6040516101629190611083565b61028f610678565b61017361068c565b6101566102ba366004610fe0565b61069b565b6101566102cd366004610fe0565b610716565b6101a66102e0366004611066565b610724565b6101ac6102f3366004611097565b61074e565b6101a6610306366004611066565b610779565b60075461028f906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b03198316148061035857506001600160e01b0319821660009081526005602052604090205460ff165b92915050565b60606003805461036d906110d0565b80601f0160208091040260200160405190810160405280929190818152602001828054610399906110d0565b80156103e65780601f106103bb576101008083540402835291602001916103e6565b820191906000526020600020905b8154815290600101906020018083116103c957829003601f168201915b5050505050905090565b6000336103fe8185856107ef565b5060019392505050565b610410610914565b61042161041b610678565b82610550565b50565b600033610432858285610973565b61043d8585856109ed565b506001949350505050565b61042181610779565b6000336103fe818585610464838361074e565b61046e9190611120565b6107ef565b61047b610678565b6001600160a01b0316336001600160a01b031614806105215750600760009054906101000a90046001600160a01b03166001600160a01b0316630759a3546040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050c9190611133565b6001600160a01b0316336001600160a01b0316145b6105465760405162461bcd60e51b815260040161053d90611150565b60405180910390fd5b61054e610bb4565b565b610558610914565b6105628282610c00565b5050565b6104213382610cd9565b610578610914565b61054e6000610e19565b61058d823383610973565b6105628282610cd9565b61059f610678565b6001600160a01b0316336001600160a01b031614806106455750600760009054906101000a90046001600160a01b03166001600160a01b0316630759a3546040518163ffffffff1660e01b8152600401602060405180830381865afa15801561060c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106309190611133565b6001600160a01b0316336001600160a01b0316145b6106615760405162461bcd60e51b815260040161053d90611150565b61054e610e73565b6000610673610678565b905090565b60065461010090046001600160a01b031690565b60606004805461036d906110d0565b600033816106a9828661074e565b9050838110156107095760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161053d565b61043d82868684036107ef565b6000336103fe8185856109ed565b61072c610914565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610781610914565b6001600160a01b0381166107e65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053d565b61042181610e19565b6001600160a01b0383166108515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053d565b6001600160a01b0382166108b25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b3361091d610678565b6001600160a01b03161461054e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161053d565b600061097f848461074e565b905060001981146109e757818110156109da5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161053d565b6109e784848484036107ef565b50505050565b6001600160a01b038316610a515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053d565b6001600160a01b038216610ab35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053d565b610abe838383610eb0565b6001600160a01b03831660009081526020819052604090205481811015610b365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161053d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610b6d908490611120565b92505081905550826001600160a01b0316846001600160a01b031660008051602061119183398151915284604051610ba791815260200190565b60405180910390a36109e7565b610bbc610ebd565b6006805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610bf69190611083565b60405180910390a1565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161053d565b610c6260008383610eb0565b8060026000828254610c749190611120565b90915550506001600160a01b03821660009081526020819052604081208054839290610ca1908490611120565b90915550506040518181526001600160a01b038316906000906000805160206111918339815191529060200160405180910390a35050565b6001600160a01b038216610d395760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161053d565b610d4582600083610eb0565b6001600160a01b03821660009081526020819052604090205481811015610db95760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161053d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610de890849061117d565b90915550506040518281526000906001600160a01b0385169060008051602061119183398151915290602001610907565b600680546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610e7b610f06565b6006805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610be93390565b610eb8610f06565b505050565b60065460ff1661054e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161053d565b60065460ff161561054e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161053d565b600060208284031215610f5e57600080fd5b81356001600160e01b031981168114610f7657600080fd5b9392505050565b600060208083528351808285015260005b81811015610faa57858101830151858201604001528201610f8e565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461042157600080fd5b60008060408385031215610ff357600080fd5b8235610ffe81610fcb565b946020939093013593505050565b60006020828403121561101e57600080fd5b5035919050565b60008060006060848603121561103a57600080fd5b833561104581610fcb565b9250602084013561105581610fcb565b929592945050506040919091013590565b60006020828403121561107857600080fd5b8135610f7681610fcb565b6001600160a01b0391909116815260200190565b600080604083850312156110aa57600080fd5b82356110b581610fcb565b915060208301356110c581610fcb565b809150509250929050565b600181811c908216806110e457607f821691505b60208210810361110457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103585761035861110a565b60006020828403121561114557600080fd5b8151610f7681610fcb565b602080825260139082015272746f6b656e206f776e6572206f72207465616d60681b604082015260600190565b818103818111156103585761035861110a56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122068859bce6181bfda57983f8c7766c681231595bd37423e8fbcee82a387fd860764736f6c63430008100033a26469706673582212204256cb7b35d84a399bd7210b2d26704d5daf469a56013ba39a04d7811e74b8db64736f6c63430008100033000000000000000000000000273e10959a456391a6ff61d03e1efb706e9e03370000000000000000000000004f1f9888c774dcef7243dff3716fc69ae39c891d0000000000000000000000002901c9e0c828c424d653d72238463ea892d309fd
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620001ba5760003560e01c80630255a03b14620001bf5780630559815914620001d85780630598c68b14620002025780630b1e423814620002195780630b8f3ee614620002505780631286ba4d14620002695780631685f29714620002805780631af2be9f1462000297578063265d1d5814620002a1578063279b136614620002ab5780635a067baa14620002c25780635bc4675c14620002cb5780635c975abb14620002f75780636eb395351462000303578063715018a61462000329578063770366841462000333578063796b89b9146200033d5780638671443a146200034457806388d5e3ce146200035b5780638da5cb5b146200037e57806395c829751462000388578063a3839d3f14620003b0578063a3d5a21f14620003d6578063a5d65e9314620003ed578063af7a060c1462000404578063bad141b8146200042a578063be733d3c1462000434578063c33857de146200044b578063cc13fd3b1462000454578063d1b812cd146200046b578063d6341862146200047f578063daeb39b51462000496578063f2fde38b14620004ad578063feac994214620004c4575b600080fd5b620001d6620001d036600462001dd7565b620004db565b005b600054620001ed90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b620001d66200021336600462001e04565b62000550565b620002417f0000000000000000000000004f1f9888c774dcef7243dff3716fc69ae39c891d81565b604051620001f9919062001e40565b6200025a600a5481565b604051908152602001620001f9565b620001d66200027a36600462001e54565b6200060c565b620001d66200029136600462001e6e565b62000652565b6200025a60095481565b6200025a600d5481565b620001d6620002bc36600462001eb0565b620006ae565b6007546200025a565b62000241620002dc36600462001dd7565b6005602052600090815260409020546001600160a01b031681565b60025460ff16620001ed565b620001ed6200031436600462001dd7565b60016020526000908152604090205460ff1681565b620001d66200070c565b6200025a60045481565b426200025a565b620001d66200035536600462002182565b62000724565b6200025a6200036c36600462001dd7565b600e6020526000908152604090205481565b6200024162001000565b620002417f000000000000000000000000273e10959a456391a6ff61d03e1efb706e9e033781565b620001ed620003c136600462001dd7565b60066020526000908152604090205460ff1681565b620001d6620003e736600462001eb0565b6200100f565b620001d6620003fe36600462001eb0565b620010c6565b620001ed6200041536600462001dd7565b60086020526000908152604090205460ff1681565b6200025a60035481565b620001d6620004453660046200229f565b62001124565b6200025a601481565b620002416200046536600462001e54565b6200118b565b600c5462000241906001600160a01b031681565b620001d66200049036600462001e54565b620011b6565b620001d6620004a736600462001e54565b620011fc565b620001d6620004be36600462001dd7565b62001288565b620001d6620004d5366004620022bf565b62001307565b620004e562001369565b620004ef620013cc565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116917f8e68ed0ed26d2aa6bca301133b429d046e7add45cb19160e3dcedd714271ddaa916200054491908490620022e2565b60405180910390a15050565b6200055b3362001417565b620005a35760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818481d985b1a59081c1c9bda9958dd606a1b60448201526064015b60405180910390fd5b6001600160a01b0382166000908152600e602052604081208054839290620005cd90849062002312565b909155505060405181815233907f338c545a8e5e070c15914aca67d4bea288f89df50423c4d0a30d7b7820ab20d4906020015b60405180910390a25050565b6200061662001369565b60048054908290556040517f30e4f9c7f8a1af88be510044d9c65e449ff53fd41daf3beab41c740c2cc9b1219062000544908490849062002328565b6200065c62001369565b620006726200066a62001000565b83836200149d565b7ffcee77aee7d834c3616e216f4b062dbcec802e05a967a6f76cd63a57654960436200069d62001000565b836040516200054492919062002336565b620006b862001369565b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917fcb27316e4c294dbd6259292315713cba48b6d131e45979befc3657958cc5baf791a35050565b6200071662001369565b62000722600062001610565b565b6200072e62001660565b620007765760405162461bcd60e51b81526020600482015260176024820152763737ba1030903b30b634b2103132ba30903a32b9ba32b960491b60448201526064016200059a565b80600954815110156200079d5760405162461bcd60e51b81526004016200059a906200234f565b600a5481511115620007c35760405162461bcd60e51b81526004016200059a906200237e565b620007cd62001690565b60075460408401513390620007e290620016d8565b6200082d5760405162461bcd60e51b815260206004820152601a6024820152791c185e5b595b9d081d1bdad95b881b9bdd08185c1c1c9bdd995960321b60448201526064016200059a565b6200083f8442600954600a5462001711565b84516001600160a01b03166200089457620008837f0000000000000000000000004f1f9888c774dcef7243dff3716fc69ae39c891d6001600160a01b03166200183f565b6001600160a01b03168552620008a1565b8451620008a190620018de565b60208501516001600160a01b03166200090e57600085606001518660800151604051620008ce9062001db3565b620008db929190620023f3565b604051809103906000f080158015620008f8573d6000803e3d6000fd5b506001600160a01b03166020870152506200091d565b6200091d8560200151620019ff565b600085602001519050306001600160a01b0316816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000995919062002425565b6001600160a01b03161462000a075760405162461bcd60e51b815260206004820152603160248201527f50726f6a65637420746f6b656e206d75737420696e697469616c6c79206265206044820152706f776e656420627920506c6174666f726d60781b60648201526084016200059a565b600062000a3d7f000000000000000000000000273e10959a456391a6ff61d03e1efb706e9e03376001600160a01b03166200183f565b875160405163189acdbd60e31b81529192506001600160a01b03169063c4d66de89062000a6f90849060040162001e40565b600060405180830381600087803b15801562000a8a57600080fd5b505af115801562000a9f573d6000803e3d6000fd5b50505050806001600160a01b031687600001516001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000af0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b16919062002425565b6001600160a01b03161462000b6e5760405162461bcd60e51b815260206004820152601e60248201527f5661756c74206d757374206265206f776e65642062792070726f6a656374000060448201526064016200059a565b6000604051806101400160405280856001600160a01b0316815260200189600001516001600160a01b03168152602001888152602001846001600160a01b0316815260200162000bbd600d5490565b81526020018960a0015181526020016003548152602001600454815260200189604001516001600160a01b031681526020018960e001518152509050816001600160a01b031663ed60844e826040518263ffffffff1660e01b815260040162000c27919062002525565b600060405180830381600087803b15801562000c4257600080fd5b505af115801562000c57573d6000803e3d6000fd5b50505050836001600160a01b0316826001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ca4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cca919062002425565b6001600160a01b03161462000d225760405162461bcd60e51b815260206004820152601d60248201527f50726f6a656374206d757374206265206f776e6564206279207465616d00000060448201526064016200059a565b6001600160a01b0380831660008181526005602052604080822080546001600160a01b031990811685179091556007805460018101825593527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909201805490921690921790555163c3856dd560e01b81529084169063c3856dd59062000dae90859060040162001e40565b600060405180830381600087803b15801562000dc957600080fd5b505af115801562000dde573d6000803e3d6000fd5b50505060c08901516040516306efd0ab60e11b81526001600160a01b0386169250630ddfa1569162000e169160040190815260200190565b600060405180830381600087803b15801562000e3157600080fd5b505af115801562000e46573d6000803e3d6000fd5b505060405163157a618f60e11b81526001600160a01b0386169250632af4c31e915062000e7890859060040162001e40565b600060405180830381600087803b15801562000e9357600080fd5b505af115801562000ea8573d6000803e3d6000fd5b50505050816001600160a01b0316836001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ef5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f1b919062002425565b6001600160a01b03161462000f835760405162461bcd60e51b815260206004820152602760248201527f50726f6a65637420746f6b656e206d757374206265206f776e656420627920506044820152666c6174666f726d60c81b60648201526084016200059a565b87600001516001600160a01b0316826001600160a01b0316867f768ca9a2690bb4dcdc8a76e37a297710292c25ea0d2c6a19f1a60a667ce486bc8a518c602001518d606001518e608001518f60c0015160035460045460405162000fee9796959493929190620025d9565b60405180910390a45050505050505050565b6000546001600160a01b031690565b6200101962001369565b6001600160a01b0382166200106d5760405162461bcd60e51b8152602060048201526019602482015278626164207061796d656e7420746f6b656e206164647265737360381b60448201526064016200059a565b6001600160a01b038216600081815260066020908152604091829020805460ff191685151590811790915591519182527f913eb45a6b9c0eef201a0ca08ba90ef347aa5330972c612123a01db6aef5adc3910162000600565b620010d062001369565b6001600160a01b038216600081815260016020526040808220805460ff191685151590811790915590519092917f124a4100d72918c516edd5da571e325eceacab225ab7b85c8496d70c638d4f5091a35050565b6200112e62001369565b60008054821515600160a01b90810260ff60a01b1983161780845560405160ff9383900484169485151594939092049092161515917f02e159cf7954f1c380c45a4213433dd148960788d130a7a9f6779391158f4edf9190a35050565b600781815481106200119c57600080fd5b6000918252602090912001546001600160a01b0316905081565b620011c062001369565b60038054908290556040517f360d4ea951ccea990cedc596e311eec2dd390cb74348c6c754f5bb0cf02acf659062000544908490849062002328565b6200120662001369565b60148111156200124c5760405162461bcd60e51b815260206004820152601060248201526f189859081c1b185d199bdc9b4818dd5d60821b60448201526064016200059a565b600d8054908290556040517f307c6d665b2784039bcbc7a05ef46d165292101a54bd1fe037036f9ea96e7b699062000544908390859062002328565b6200129262001369565b6001600160a01b038116620012f95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200059a565b620013048162001610565b50565b6200131162001369565b60098054600a805492859055839055604051909190819083907f1855cffd4cf3e4971fe04a2b5bf4826b4dd9dd64c752058388c6cc0fbb66c196906200135b908890889062002328565b60405180910390a350505050565b336200137462001000565b6001600160a01b031614620007225760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200059a565b60025460ff16620007225760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016200059a565b6001600160a01b038082166000908152600560209081526040808320548151637a1c878160e11b815291519394859491169263f4390f0292600480820193918290030181865afa15801562001470573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001496919062002639565b1192915050565b6001600160a01b0381166000908152600e6020526040902054821115620015075760405162461bcd60e51b815260206004820152601d60248201527f6e6f7420656e6f75676820746f6b656e7320696e20706c6174666f726d00000060448201526064016200059a565b6001600160a01b0381166000908152600e6020526040812080548492906200153190849062002653565b909155505060405163a9059cbb60e01b81526000906001600160a01b0383169063a9059cbb9062001569908790879060040162002336565b6020604051808303816000875af115801562001589573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015af919062002669565b9050806200160a5760405162461bcd60e51b815260206004820152602160248201527f4661696c656420746f207472616e73666572207061796d656e7420746f6b656e6044820152607360f81b60648201526084016200059a565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008054600160a01b900460ff16620016795750600190565b503360009081526001602052604090205460ff1690565b60025460ff1615620007225760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016200059a565b60006001600160a01b038216158015906200170b57506001600160a01b03821660009081526006602052604090205460ff165b92915050565b81158062001720575081845110155b6200173f5760405162461bcd60e51b81526004016200059a906200234f565b8015806200174e575080845111155b6200176d5760405162461bcd60e51b81526004016200059a906200237e565b60005b84518110156200183857620017a78186838151811062001794576200179462002689565b6020026020010151604001518662001ae3565b620017d381868381518110620017c157620017c162002689565b60200260200101516000015162001b55565b6000858281518110620017ea57620017ea62002689565b60200260200101516020019060028111156200180a576200180a62002445565b9081600281111562001820576200182062002445565b905250806200182f816200269f565b91505062001770565b5050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b038116620018d95760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016200059a565b919050565b6001600160a01b03811660009081526008602052604090205460ff166200191e578033604051637b4fa80960e11b81526004016200059a929190620022e2565b620019298162001cb8565b6200194b57806040516357b980d760e11b81526004016200059a919062001e40565b6000816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200198c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620019b2919062002425565b90506001600160a01b0381163014801590620019d657506001600160a01b03811615155b15620019fb578181604051631d4df08f60e21b81526004016200059a929190620022e2565b5050565b62001a1281630b54881b60e21b62001cc8565b62001a335780604051628fbd1760e41b81526004016200059a919062001e40565b6000816001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001a74573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001a9a919062002425565b90506001600160a01b038116301480159062001abe57506001600160a01b03811615155b15620019fb578181604051631e290b4d60e21b81526004016200059a929190620022e2565b62001af2620151808262002312565b8263ffffffff16108062001b1a575062001b116301e133808262002312565b8263ffffffff16115b1562001b5057604051634753f59560e01b81526004810184905263ffffffff83166024820152604481018290526064016200059a565b505050565b80516000906001600160a01b031615158062001b75575060008260400151115b8062001b8b57506000826020015163ffffffff16115b90508062001bb0576040516328eeae7960e11b8152600481018490526024016200059a565b81516000906001600160a01b0316158062001be15750604083015115801562001be15750602083015163ffffffff16155b9050600083604001516000148062001c15575083516001600160a01b031615801562001c155750602084015163ffffffff16155b90506000846020015163ffffffff166000148062001c49575084516001600160a01b031615801562001c4957506040850151155b905082158062001c57575081155b8062001c61575080155b1562001cb0578451604080870151602088015191516307ee0dc560e41b8152600481018a90526001600160a01b039093166024840152604483015263ffffffff1660648201526084016200059a565b505050505050565b60006200170b8263bfe3580d60e01b5b600062001cd58362001cf0565b801562001ce9575062001ce9838362001d28565b9392505050565b600062001d05826301ffc9a760e01b62001d28565b80156200170b575062001d21826001600160e01b031962001d28565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d9150600051905082801562001d9b575060208210155b801562001da85750600081115b979650505050505050565b6115e380620026bc83390190565b6001600160a01b03811681146200130457600080fd5b60006020828403121562001dea57600080fd5b813562001ce98162001dc1565b8035620018d98162001dc1565b6000806040838503121562001e1857600080fd5b823562001e258162001dc1565b946020939093013593505050565b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b60006020828403121562001e6757600080fd5b5035919050565b6000806040838503121562001e8257600080fd5b82359150602083013562001e968162001dc1565b809150509250929050565b80151581146200130457600080fd5b6000806040838503121562001ec457600080fd5b823562001ed18162001dc1565b9150602083013562001e968162001ea1565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b60405290565b604051606081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b60405161010081016001600160401b038111828210171562001f1e5762001f1e62001ee3565b604051601f8201601f191681016001600160401b038111828210171562001f9a5762001f9a62001ee3565b604052919050565b600082601f83011262001fb457600080fd5b81356001600160401b0381111562001fd05762001fd062001ee3565b62001fe5601f8201601f191660200162001f6f565b81815284602083860101111562001ffb57600080fd5b816020850160208301376000918101602001919091529392505050565b803563ffffffff81168114620018d957600080fd5b803560038110620018d957600080fd5b8035600381900b8114620018d957600080fd5b600082601f8301126200206257600080fd5b813560206001600160401b0382111562002080576200208062001ee3565b62002090818360051b0162001f6f565b82815260e09283028501820192828201919087851115620020b057600080fd5b8387015b85811015620021755780890382811215620020cf5760008081fd5b620020d962001ef9565b606080831215620020ea5760008081fd5b620020f462001f24565b92508335620021038162001dc1565b83526200211284890162002018565b8884015260408085013581850152838352620021308286016200202d565b89840152608093506200214584860162002018565b908301526200215760a085016200203d565b9082015260c0830135918101919091528452928401928101620020b4565b5090979650505050505050565b600080604083850312156200219657600080fd5b82356001600160401b0380821115620021ae57600080fd5b908401906101008287031215620021c457600080fd5b620021ce62001f49565b620021d98362001df7565b8152620021e96020840162001df7565b6020820152620021fc6040840162001df7565b60408201526060830135828111156200221457600080fd5b620022228882860162001fa2565b6060830152506080830135828111156200223b57600080fd5b620022498882860162001fa2565b60808301525060a083013560a082015260c083013560c082015260e083013560e08201528094505060208501359150808211156200228657600080fd5b50620022958582860162002050565b9150509250929050565b600060208284031215620022b257600080fd5b813562001ce98162001ea1565b60008060408385031215620022d357600080fd5b50508035926020909101359150565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052601160045260246000fd5b808201808211156200170b576200170b620022fc565b918252602082015260400190565b6001600160a01b03929092168252602082015260400190565b6020808252601590820152746e6f7420656e6f756768206d696c6573746f6e657360581b604082015260600190565b602080825260139082015272746f6f206d616e79206d696c6573746f6e657360681b604082015260600190565b6000815180845260005b81811015620023d357602081850181015186830182015201620023b5565b506000602082860101526020601f19601f83011685010191505092915050565b604081526000620024086040830185620023ab565b82810360208401526200241c8185620023ab565b95945050505050565b6000602082840312156200243857600080fd5b815162001ce98162001dc1565b634e487b7160e01b600052602160045260246000fd5b60008151808452602080850194508084016000805b8481101562002519578251805180516001600160a01b03168a528581015163ffffffff16868b0152604090810151818b01528582015190606060038310620024c657634e487b7160e01b86526021600452602486fd5b8b81019290925282015190608090620024e6828d018463ffffffff169052565b8301519150620024fb60a08c018360030b9052565b919091015160c08a01525060e0909701969183019160010162002470565b50959695505050505050565b602081526200253960208201835162001e33565b600060208301516200254f604084018262001e33565b5060408301516101408060608501526200256e6101608501836200245b565b9150606085015162002584608086018262001e33565b50608085015160a085015260a085015160c085015260c085015160e085015260e0850151610100818187015280870151915050610120620025c88187018362001e33565b959095015193019290925250919050565b8781526001600160a01b038716602082015260e0604082018190526000906200260590830188620023ab565b8281036060840152620026198188620023ab565b6080840196909652505060a081019290925260c090910152949350505050565b6000602082840312156200264c57600080fd5b5051919050565b818103818111156200170b576200170b620022fc565b6000602082840312156200267c57600080fd5b815162001ce98162001ea1565b634e487b7160e01b600052603260045260246000fd5b600060018201620026b457620026b4620022fc565b506001019056fe60806040523480156200001157600080fd5b50604051620015e3380380620015e3833981016040819052620000349162000228565b8181600362000044838262000321565b50600462000053828262000321565b50506006805460ff19169055506200006b3362000085565b6200007d630b54881b60e21b620000df565b5050620003ed565b600680546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160e01b031980821690036200013e5760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152600560205260409020805460ff19166001179055565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200018b57600080fd5b81516001600160401b0380821115620001a857620001a862000163565b604051601f8301601f19908116603f01168101908282118183101715620001d357620001d362000163565b81604052838152602092508683858801011115620001f057600080fd5b600091505b83821015620002145785820183015181830184015290820190620001f5565b600093810190920192909252949350505050565b600080604083850312156200023c57600080fd5b82516001600160401b03808211156200025457600080fd5b620002628683870162000179565b935060208501519150808211156200027957600080fd5b50620002888582860162000179565b9150509250929050565b600181811c90821680620002a757607f821691505b602082108103620002c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200031c57600081815260208120601f850160051c81016020861015620002f75750805b601f850160051c820191505b81811015620003185782815560010162000303565b5050505b505050565b81516001600160401b038111156200033d576200033d62000163565b62000355816200034e845462000292565b84620002ce565b602080601f8311600181146200038d5760008415620003745750858301515b600019600386901b1c1916600185901b17855562000318565b600085815260208120601f198616915b82811015620003be578886015182559484019460019091019084016200039d565b5085821015620003dd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6111e680620003fd6000396000f3fe608060405234801561001057600080fd5b506004361061013e5760003560e01c806301ffc9a71461014357806306fdde031461016b578063095ea7b3146101805780630ddfa1561461019357806318160ddd146101a857806323b872dd146101ba5780632af4c31e146101cd578063313ce567146101e057806339509351146101ef5780633f4ba83a1461020257806340c10f191461020a57806342966c681461021d5780635c975abb1461023057806370a082311461023b578063715018a61461026457806379cc67901461026c5780638456cb591461027f578063893d20e8146102875780638da5cb5b1461029c57806395d89b41146102a4578063a457c2d7146102ac578063a9059cbb146102bf578063c3856dd5146102d2578063dd62ed3e146102e5578063f2fde38b146102f8578063f60ca60d1461030b575b600080fd5b610156610151366004610f4c565b61031e565b60405190151581526020015b60405180910390f35b61017361035e565b6040516101629190610f7d565b61015661018e366004610fe0565b6103f0565b6101a66101a136600461100c565b610408565b005b6002545b604051908152602001610162565b6101566101c8366004611025565b610424565b6101a66101db366004611066565b610448565b60405160128152602001610162565b6101566101fd366004610fe0565b610451565b6101a6610473565b6101a6610218366004610fe0565b610550565b6101a661022b36600461100c565b610566565b60065460ff16610156565b6101ac610249366004611066565b6001600160a01b031660009081526020819052604090205490565b6101a6610570565b6101a661027a366004610fe0565b610582565b6101a6610597565b61028f610669565b6040516101629190611083565b61028f610678565b61017361068c565b6101566102ba366004610fe0565b61069b565b6101566102cd366004610fe0565b610716565b6101a66102e0366004611066565b610724565b6101ac6102f3366004611097565b61074e565b6101a6610306366004611066565b610779565b60075461028f906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b03198316148061035857506001600160e01b0319821660009081526005602052604090205460ff165b92915050565b60606003805461036d906110d0565b80601f0160208091040260200160405190810160405280929190818152602001828054610399906110d0565b80156103e65780601f106103bb576101008083540402835291602001916103e6565b820191906000526020600020905b8154815290600101906020018083116103c957829003601f168201915b5050505050905090565b6000336103fe8185856107ef565b5060019392505050565b610410610914565b61042161041b610678565b82610550565b50565b600033610432858285610973565b61043d8585856109ed565b506001949350505050565b61042181610779565b6000336103fe818585610464838361074e565b61046e9190611120565b6107ef565b61047b610678565b6001600160a01b0316336001600160a01b031614806105215750600760009054906101000a90046001600160a01b03166001600160a01b0316630759a3546040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050c9190611133565b6001600160a01b0316336001600160a01b0316145b6105465760405162461bcd60e51b815260040161053d90611150565b60405180910390fd5b61054e610bb4565b565b610558610914565b6105628282610c00565b5050565b6104213382610cd9565b610578610914565b61054e6000610e19565b61058d823383610973565b6105628282610cd9565b61059f610678565b6001600160a01b0316336001600160a01b031614806106455750600760009054906101000a90046001600160a01b03166001600160a01b0316630759a3546040518163ffffffff1660e01b8152600401602060405180830381865afa15801561060c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106309190611133565b6001600160a01b0316336001600160a01b0316145b6106615760405162461bcd60e51b815260040161053d90611150565b61054e610e73565b6000610673610678565b905090565b60065461010090046001600160a01b031690565b60606004805461036d906110d0565b600033816106a9828661074e565b9050838110156107095760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161053d565b61043d82868684036107ef565b6000336103fe8185856109ed565b61072c610914565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610781610914565b6001600160a01b0381166107e65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053d565b61042181610e19565b6001600160a01b0383166108515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053d565b6001600160a01b0382166108b25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b3361091d610678565b6001600160a01b03161461054e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161053d565b600061097f848461074e565b905060001981146109e757818110156109da5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161053d565b6109e784848484036107ef565b50505050565b6001600160a01b038316610a515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053d565b6001600160a01b038216610ab35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053d565b610abe838383610eb0565b6001600160a01b03831660009081526020819052604090205481811015610b365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161053d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610b6d908490611120565b92505081905550826001600160a01b0316846001600160a01b031660008051602061119183398151915284604051610ba791815260200190565b60405180910390a36109e7565b610bbc610ebd565b6006805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610bf69190611083565b60405180910390a1565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161053d565b610c6260008383610eb0565b8060026000828254610c749190611120565b90915550506001600160a01b03821660009081526020819052604081208054839290610ca1908490611120565b90915550506040518181526001600160a01b038316906000906000805160206111918339815191529060200160405180910390a35050565b6001600160a01b038216610d395760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161053d565b610d4582600083610eb0565b6001600160a01b03821660009081526020819052604090205481811015610db95760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161053d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610de890849061117d565b90915550506040518281526000906001600160a01b0385169060008051602061119183398151915290602001610907565b600680546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610e7b610f06565b6006805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610be93390565b610eb8610f06565b505050565b60065460ff1661054e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161053d565b60065460ff161561054e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161053d565b600060208284031215610f5e57600080fd5b81356001600160e01b031981168114610f7657600080fd5b9392505050565b600060208083528351808285015260005b81811015610faa57858101830151858201604001528201610f8e565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461042157600080fd5b60008060408385031215610ff357600080fd5b8235610ffe81610fcb565b946020939093013593505050565b60006020828403121561101e57600080fd5b5035919050565b60008060006060848603121561103a57600080fd5b833561104581610fcb565b9250602084013561105581610fcb565b929592945050506040919091013590565b60006020828403121561107857600080fd5b8135610f7681610fcb565b6001600160a01b0391909116815260200190565b600080604083850312156110aa57600080fd5b82356110b581610fcb565b915060208301356110c581610fcb565b809150509250929050565b600181811c908216806110e457607f821691505b60208210810361110457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103585761035861110a565b60006020828403121561114557600080fd5b8151610f7681610fcb565b602080825260139082015272746f6b656e206f776e6572206f72207465616d60681b604082015260600190565b818103818111156103585761035861110a56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122068859bce6181bfda57983f8c7766c681231595bd37423e8fbcee82a387fd860764736f6c63430008100033a26469706673582212204256cb7b35d84a399bd7210b2d26704d5daf469a56013ba39a04d7811e74b8db64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000273e10959a456391a6ff61d03e1efb706e9e03370000000000000000000000004f1f9888c774dcef7243dff3716fc69ae39c891d0000000000000000000000002901c9e0c828c424d653d72238463ea892d309fd
-----Decoded View---------------
Arg [0] : projectTemplate_ (address): 0x273e10959A456391a6Ff61D03e1EFB706E9e0337
Arg [1] : vaultTemplate_ (address): 0x4F1f9888C774dcef7243dff3716Fc69ae39c891D
Arg [2] : platformToken_ (address): 0x2901c9E0c828C424D653d72238463Ea892D309fd
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000273e10959a456391a6ff61d03e1efb706e9e0337
Arg [1] : 0000000000000000000000004f1f9888c774dcef7243dff3716fc69ae39c891d
Arg [2] : 0000000000000000000000002901c9e0c828c424d653d72238463ea892d309fd
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.