More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 41 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swipe | 7062305 | 2236 days ago | IN | 0 ETH | 0.0000975 | ||||
Sunset | 6356313 | 2354 days ago | IN | 0 ETH | 0.0001679 | ||||
Withdraw | 5783285 | 2451 days ago | IN | 0 ETH | 0.00019129 | ||||
Withdraw | 5783275 | 2451 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5783262 | 2451 days ago | IN | 0 ETH | 0.00009564 | ||||
Withdraw | 5783248 | 2451 days ago | IN | 0 ETH | 0.00014347 | ||||
Refund | 5596697 | 2484 days ago | IN | 0 ETH | 0.00069092 | ||||
Withdraw | 5562214 | 2490 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5562211 | 2490 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5562191 | 2490 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5562186 | 2490 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5397598 | 2518 days ago | IN | 0 ETH | 0.00004782 | ||||
Withdraw | 5397591 | 2518 days ago | IN | 0 ETH | 0.00004782 | ||||
Withdraw | 5397583 | 2518 days ago | IN | 0 ETH | 0.00004782 | ||||
Transfer | 5289368 | 2536 days ago | IN | 0.5 ETH | 0.00004759 | ||||
Withdraw | 5267718 | 2540 days ago | IN | 0 ETH | 0.00009564 | ||||
Withdraw | 5214687 | 2549 days ago | IN | 0 ETH | 0.00009564 | ||||
Withdraw | 5168716 | 2556 days ago | IN | 0 ETH | 0.00014347 | ||||
Withdraw | 5168692 | 2556 days ago | IN | 0 ETH | 0.00009564 | ||||
Withdraw | 5149272 | 2560 days ago | IN | 0 ETH | 0.00009564 | ||||
Transfer | 5131915 | 2563 days ago | IN | 0.1 ETH | 0.00029861 | ||||
Transfer | 5093390 | 2569 days ago | IN | 0.5 ETH | 0.00008128 | ||||
Withdraw | 5062205 | 2575 days ago | IN | 0 ETH | 0.00004782 | ||||
Withdraw | 5062202 | 2575 days ago | IN | 0 ETH | 0.00004782 | ||||
Withdraw | 4974117 | 2589 days ago | IN | 0 ETH | 0.00014347 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
7062305 | 2236 days ago | 0.9455181 ETH | ||||
5783285 | 2451 days ago | 0.10505756 ETH | ||||
5783275 | 2451 days ago | 0.11673063 ETH | ||||
5783262 | 2451 days ago | 0.1297007 ETH | ||||
5783248 | 2451 days ago | 0.14411188 ETH | ||||
5596697 | 2484 days ago | 0.02824295 ETH | ||||
5562214 | 2490 days ago | 0.16326242 ETH | ||||
5562211 | 2490 days ago | 0.18140269 ETH | ||||
5562191 | 2490 days ago | 0.20155855 ETH | ||||
5562186 | 2490 days ago | 0.22395394 ETH | ||||
5397598 | 2518 days ago | 0.24883771 ETH | ||||
5397591 | 2518 days ago | 0.27648635 ETH | ||||
5397583 | 2518 days ago | 0.30720706 ETH | ||||
5267718 | 2540 days ago | 0.28578562 ETH | ||||
5214687 | 2549 days ago | 0.31753958 ETH | ||||
5168716 | 2556 days ago | 0.35282175 ETH | ||||
5168692 | 2556 days ago | 0.39202417 ETH | ||||
5149272 | 2560 days ago | 0.43558241 ETH | ||||
5062205 | 2575 days ago | 0.41731379 ETH | ||||
5062202 | 2575 days ago | 0.46368199 ETH | ||||
4974117 | 2589 days ago | 0.51520221 ETH | ||||
4974058 | 2589 days ago | 0.5724469 ETH | ||||
4887173 | 2605 days ago | 0.62494101 ETH | ||||
4872021 | 2608 days ago | 0.6943789 ETH | ||||
4814013 | 2618 days ago | 0.660421 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x8c79ec3f...90b87F8F1 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StakeTreeWithTokenization
Compiler Version
v0.4.15+commit.bbb8e64f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-11-03 */ pragma solidity 0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Controlled { /// @notice The address of the controller is the only address that can call /// a function with this modifier modifier onlyController { require(msg.sender == controller); _; } address public controller; function Controlled() public { controller = msg.sender;} /// @notice Changes the controller of the contract /// @param _newController The new controller of the contract function changeController(address _newController) public onlyController { controller = _newController; } } /* Copyright 2016, Jordi Baylina This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /// @title MiniMeToken Contract /// @author Jordi Baylina /// @dev This token contract's goal is to make it easy for anyone to clone this /// token using the token distribution at a given block, this will allow DAO's /// and DApps to upgrade their features in a decentralized manner without /// affecting the original token /// @dev It is ERC20 compliant, but still needs to under go further testing. contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public; } /// @dev The actual token contract, the default controller is the msg.sender /// that deploys the contract, so usually this token will be deployed by a /// token controller contract, which Giveth will call a "Campaign" contract MiniMeToken is Controlled { string public name; //The Token's name: e.g. DigixDAO Tokens uint8 public decimals; //Number of decimals of the smallest unit string public symbol; //An identifier: e.g. REP string public version = 'MMT_0.2'; //An arbitrary versioning scheme /// @dev `Checkpoint` is the structure that attaches a block number to a /// given value, the block number attached is the one that last changed the /// value struct Checkpoint { // `fromBlock` is the block number that the value was generated from uint128 fromBlock; // `value` is the amount of tokens at a specific block number uint128 value; } // `parentToken` is the Token address that was cloned to produce this token; // it will be 0x0 for a token that was not cloned MiniMeToken public parentToken; // `parentSnapShotBlock` is the block number from the Parent Token that was // used to determine the initial distribution of the Clone Token uint public parentSnapShotBlock; // `creationBlock` is the block number that the Clone Token was created uint public creationBlock; // `balances` is the map that tracks the balance of each address, in this // contract when the balance changes the block number that the change // occurred is also included in the map mapping (address => Checkpoint[]) balances; // `allowed` tracks any extra transfer rights as in all ERC20 tokens mapping (address => mapping (address => uint256)) allowed; // Tracks the history of the `totalSupply` of the token Checkpoint[] totalSupplyHistory; // Flag that determines if the token is transferable or not. bool public transfersEnabled; // The factory used to create new clone tokens MiniMeTokenFactory public tokenFactory; //////////////// // Constructor //////////////// /// @notice Constructor to create a MiniMeToken /// @param _tokenFactory The address of the MiniMeTokenFactory contract that /// will create the Clone token contracts, the token factory needs to be /// deployed first /// @param _parentToken Address of the parent token, set to 0x0 if it is a /// new token /// @param _parentSnapShotBlock Block of the parent token that will /// determine the initial distribution of the clone token, set to 0 if it /// is a new token /// @param _tokenName Name of the new token /// @param _decimalUnits Number of decimals of the new token /// @param _tokenSymbol Token Symbol for the new token /// @param _transfersEnabled If true, tokens will be able to be transferred function MiniMeToken( address _tokenFactory, address _parentToken, uint _parentSnapShotBlock, string _tokenName, uint8 _decimalUnits, string _tokenSymbol, bool _transfersEnabled ) public { tokenFactory = MiniMeTokenFactory(_tokenFactory); name = _tokenName; // Set the name decimals = _decimalUnits; // Set the decimals symbol = _tokenSymbol; // Set the symbol parentToken = MiniMeToken(_parentToken); parentSnapShotBlock = _parentSnapShotBlock; transfersEnabled = _transfersEnabled; creationBlock = block.number; } /////////////////// // ERC20 Methods /////////////////// /// @notice Send `_amount` tokens to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _amount The amount of tokens to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _amount) public returns (bool success) { require(transfersEnabled); return doTransfer(msg.sender, _to, _amount); } /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it /// is approved by `_from` /// @param _from The address holding the tokens being transferred /// @param _to The address of the recipient /// @param _amount The amount of tokens to be transferred /// @return True if the transfer was successful function transferFrom(address _from, address _to, uint256 _amount ) public returns (bool success) { // The controller of this contract can move tokens around at will, // this is important to recognize! Confirm that you trust the // controller of this contract, which in most situations should be // another open source smart contract or 0x0 if (msg.sender != controller) { require(transfersEnabled); // The standard ERC 20 transferFrom functionality if (allowed[_from][msg.sender] < _amount) return false; allowed[_from][msg.sender] -= _amount; } return doTransfer(_from, _to, _amount); } /// @dev This is the actual transfer function in the token contract, it can /// only be called by other functions in this contract. /// @param _from The address holding the tokens being transferred /// @param _to The address of the recipient /// @param _amount The amount of tokens to be transferred /// @return True if the transfer was successful function doTransfer(address _from, address _to, uint _amount ) internal returns(bool) { if (_amount == 0) { return true; } require(parentSnapShotBlock < block.number); // Do not allow transfer to 0x0 or the token contract itself require((_to != 0) && (_to != address(this))); // If the amount being transfered is more than the balance of the // account the transfer returns false var previousBalanceFrom = balanceOfAt(_from, block.number); if (previousBalanceFrom < _amount) { return false; } // First update the balance array with the new value for the address // sending the tokens updateValueAtNow(balances[_from], previousBalanceFrom - _amount); // Then update the balance array with the new value for the address // receiving the tokens var previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount); // An event to make the transfer easy to find on the blockchain Transfer(_from, _to, _amount); return true; } /// @param _owner The address that's balance is being requested /// @return The balance of `_owner` at the current block function balanceOf(address _owner) public constant returns (uint256 balance) { return balanceOfAt(_owner, block.number); } /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on /// its behalf. This is a modified version of the ERC20 approve function /// to be a little bit safer /// @param _spender The address of the account able to transfer the tokens /// @param _amount The amount of tokens to be approved for transfer /// @return True if the approval was successful function approve(address _spender, uint256 _amount) public returns (bool success) { require(transfersEnabled); // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender,0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } /// @dev This function makes it easy to read the `allowed[]` map /// @param _owner The address of the account that owns the token /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens of _owner that _spender is allowed /// to spend function allowance(address _owner, address _spender ) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on /// its behalf, and then a function is triggered in the contract that is /// being approved, `_spender`. This allows users to use their tokens to /// interact with contracts in one function call instead of two /// @param _spender The address of the contract able to transfer the tokens /// @param _amount The amount of tokens to be approved for transfer /// @return True if the function call was successful function approveAndCall(address _spender, uint256 _amount, bytes _extraData ) public returns (bool success) { require(approve(_spender, _amount)); ApproveAndCallFallBack(_spender).receiveApproval( msg.sender, _amount, this, _extraData ); return true; } /// @dev This function makes it easy to get the total number of tokens /// @return The total number of tokens function totalSupply() public constant returns (uint) { return totalSupplyAt(block.number); } //////////////// // Query balance and totalSupply in History //////////////// /// @dev Queries the balance of `_owner` at a specific `_blockNumber` /// @param _owner The address from which the balance will be retrieved /// @param _blockNumber The block number when the balance is queried /// @return The balance at `_blockNumber` function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint) { // These next few lines are used when the balance of the token is // requested before a check point was ever created for this token, it // requires that the `parentToken.balanceOfAt` be queried at the // genesis block for that token as this contains initial balance of // this token if ((balances[_owner].length == 0) || (balances[_owner][0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock)); } else { // Has no parent return 0; } // This will return the expected balance during normal situations } else { return getValueAt(balances[_owner], _blockNumber); } } /// @notice Total amount of tokens at a specific `_blockNumber`. /// @param _blockNumber The block number when the totalSupply is queried /// @return The total amount of tokens at `_blockNumber` function totalSupplyAt(uint _blockNumber) public constant returns(uint) { // These next few lines are used when the totalSupply of the token is // requested before a check point was ever created for this token, it // requires that the `parentToken.totalSupplyAt` be queried at the // genesis block for this token as that contains totalSupply of this // token at this block number. if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); } else { return 0; } // This will return the expected totalSupply during normal situations } else { return getValueAt(totalSupplyHistory, _blockNumber); } } //////////////// // Clone Token Method //////////////// /// @notice Creates a new clone token with the initial distribution being /// this token at `_snapshotBlock` /// @param _cloneTokenName Name of the clone token /// @param _cloneDecimalUnits Number of decimals of the smallest unit /// @param _cloneTokenSymbol Symbol of the clone token /// @param _snapshotBlock Block when the distribution of the parent token is /// copied to set the initial distribution of the new clone token; /// if the block is zero than the actual block, the current block is used /// @param _transfersEnabled True if transfers are allowed in the clone /// @return The address of the new MiniMeToken Contract function createCloneToken( string _cloneTokenName, uint8 _cloneDecimalUnits, string _cloneTokenSymbol, uint _snapshotBlock, bool _transfersEnabled ) public returns(address) { if (_snapshotBlock == 0) _snapshotBlock = block.number; MiniMeToken cloneToken = tokenFactory.createCloneToken( this, _snapshotBlock, _cloneTokenName, _cloneDecimalUnits, _cloneTokenSymbol, _transfersEnabled ); cloneToken.changeController(msg.sender); // An event to make the token easy to find on the blockchain NewCloneToken(address(cloneToken), _snapshotBlock); return address(cloneToken); } //////////////// // Generate and destroy tokens //////////////// /// @notice Generates `_amount` tokens that are assigned to `_owner` /// @param _owner The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly function generateTokens(address _owner, uint _amount ) public onlyController returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount); updateValueAtNow(balances[_owner], previousBalanceTo + _amount); Transfer(0, _owner, _amount); return true; } /// @notice Burns `_amount` tokens from `_owner` /// @param _owner The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly function destroyTokens(address _owner, uint _amount ) onlyController public returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply >= _amount); uint previousBalanceFrom = balanceOf(_owner); require(previousBalanceFrom >= _amount); updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount); updateValueAtNow(balances[_owner], previousBalanceFrom - _amount); Transfer(_owner, 0, _amount); return true; } //////////////// // Enable tokens transfers //////////////// /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone function enableTransfers(bool _transfersEnabled) public onlyController { transfersEnabled = _transfersEnabled; } //////////////// // Internal helper functions to query and set a value in a snapshot array //////////////// /// @dev `getValueAt` retrieves the number of tokens at a given block number /// @param checkpoints The history of values being queried /// @param _block The block number to retrieve the value at /// @return The number of tokens being queried function getValueAt(Checkpoint[] storage checkpoints, uint _block ) constant internal returns (uint) { if (checkpoints.length == 0) return 0; // Shortcut for the actual value if (_block >= checkpoints[checkpoints.length-1].fromBlock) return checkpoints[checkpoints.length-1].value; if (_block < checkpoints[0].fromBlock) return 0; // Binary search of the value in the array uint min = 0; uint max = checkpoints.length-1; while (max > min) { uint mid = (max + min + 1)/ 2; if (checkpoints[mid].fromBlock<=_block) { min = mid; } else { max = mid-1; } } return checkpoints[min].value; } /// @dev `updateValueAtNow` used to update the `balances` map and the /// `totalSupplyHistory` /// @param checkpoints The history of data being updated /// @param _value The new number of tokens function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value ) internal { if ((checkpoints.length == 0) || (checkpoints[checkpoints.length -1].fromBlock < block.number)) { Checkpoint storage newCheckPoint = checkpoints[ checkpoints.length++ ]; newCheckPoint.fromBlock = uint128(block.number); newCheckPoint.value = uint128(_value); } else { Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length-1]; oldCheckPoint.value = uint128(_value); } } /// @dev Internal function to determine if an address is a contract /// @param _addr The address being queried /// @return True if `_addr` is a contract function isContract(address _addr) constant internal returns(bool) { uint size; if (_addr == 0) return false; assembly { size := extcodesize(_addr) } return size>0; } /// @dev Helper function to return a min betwen the two uints /// PURE function function min(uint a, uint b) internal constant returns (uint) { return a < b ? a : b; } /// @notice The fallback function: If the contract's controller has not been /// set to 0, then the `proxyPayment` method is called which relays the /// ether and creates tokens as described in the token controller contract function () public payable { } ////////// // Safety Methods ////////// /// @notice This method can be used by the controller to extract mistakenly /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address _token) public onlyController { if (_token == 0x0) { controller.transfer(this.balance); return; } MiniMeToken token = MiniMeToken(_token); uint balance = token.balanceOf(this); token.transfer(controller, balance); ClaimedTokens(_token, controller, balance); } //////////////// // Events //////////////// event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount); event Transfer(address indexed _from, address indexed _to, uint256 _amount); event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock); event Approval( address indexed _owner, address indexed _spender, uint256 _amount ); } //////////////// // MiniMeTokenFactory //////////////// /// @dev This contract is used to generate clone contracts from a contract. /// In solidity this is the way to create a contract from a contract of the /// same class contract MiniMeTokenFactory { /// @notice Update the DApp by creating a new token with new functionalities /// the msg.sender becomes the controller of this clone token /// @param _parentToken Address of the token being cloned /// @param _snapshotBlock Block of the parent token that will /// determine the initial distribution of the clone token /// @param _tokenName Name of the new token /// @param _decimalUnits Number of decimals of the new token /// @param _tokenSymbol Token Symbol for the new token /// @param _transfersEnabled If true, tokens will be able to be transferred /// @return The address of the new token contract function createCloneToken( address _parentToken, uint _snapshotBlock, string _tokenName, uint8 _decimalUnits, string _tokenSymbol, bool _transfersEnabled ) public returns (MiniMeToken) { MiniMeToken newToken = new MiniMeToken( this, _parentToken, _snapshotBlock, _tokenName, _decimalUnits, _tokenSymbol, _transfersEnabled ); newToken.changeController(msg.sender); return newToken; } } contract StakeTreeWithTokenization { using SafeMath for uint256; uint public version = 2; struct Funder { bool exists; uint balance; uint withdrawalEntry; uint contribution; uint contributionClaimed; } mapping(address => Funder) public funders; bool public live = true; // For sunsetting contract uint public totalCurrentFunders = 0; // Keeps track of total funders uint public withdrawalCounter = 0; // Keeps track of how many withdrawals have taken place uint public sunsetWithdrawDate; MiniMeToken public tokenContract; MiniMeTokenFactory public tokenFactory; bool public tokenized = false; bool public canClaimTokens = false; address public beneficiary; // Address for beneficiary uint public sunsetWithdrawalPeriod; // How long it takes for beneficiary to swipe contract when put into sunset mode uint public withdrawalPeriod; // How long the beneficiary has to wait withdraw uint public minimumFundingAmount; // Setting used for setting minimum amounts to fund contract with uint public lastWithdrawal; // Last withdrawal time uint public nextWithdrawal; // Next withdrawal time uint public contractStartTime; // For accounting purposes event Payment(address indexed funder, uint amount); event Refund(address indexed funder, uint amount); event Withdrawal(uint amount); event TokensClaimed(address indexed funder, uint amount); event Sunset(bool hasSunset); function StakeTreeWithTokenization( address beneficiaryAddress, uint withdrawalPeriodInit, uint withdrawalStart, uint sunsetWithdrawPeriodInit, uint minimumFundingAmountInit) { beneficiary = beneficiaryAddress; withdrawalPeriod = withdrawalPeriodInit; sunsetWithdrawalPeriod = sunsetWithdrawPeriodInit; lastWithdrawal = withdrawalStart; nextWithdrawal = lastWithdrawal + withdrawalPeriod; minimumFundingAmount = minimumFundingAmountInit; contractStartTime = now; } // Modifiers modifier onlyByBeneficiary() { require(msg.sender == beneficiary); _; } modifier onlyWhenTokenized() { require(isTokenized()); _; } modifier onlyByFunder() { require(isFunder(msg.sender)); _; } modifier onlyAfterNextWithdrawalDate() { require(now >= nextWithdrawal); _; } modifier onlyWhenLive() { require(live); _; } modifier onlyWhenSunset() { require(!live); _; } /* * External accounts can pay directly to contract to fund it. */ function () payable { fund(); } /* * Additional api for contracts to use as well * Can only happen when live and over a minimum amount set by the beneficiary */ function fund() public payable onlyWhenLive { require(msg.value >= minimumFundingAmount); // Only increase total funders when we have a new funder if(!isFunder(msg.sender)) { totalCurrentFunders = totalCurrentFunders.add(1); // Increase total funder count funders[msg.sender] = Funder({ exists: true, balance: msg.value, withdrawalEntry: withdrawalCounter, // Set the withdrawal counter. Ie at which withdrawal the funder "entered" the patronage contract contribution: 0, contributionClaimed: 0 }); } else { consolidateFunder(msg.sender, msg.value); } Payment(msg.sender, msg.value); } // Pure functions /* * This function calculates how much the beneficiary can withdraw. * Due to no floating points in Solidity, we will lose some fidelity * if there's wei on the last digit. The beneficiary loses a neglibible amount * to withdraw but this benefits the beneficiary again on later withdrawals. * We multiply by 10 (which corresponds to the 10%) * then divide by 100 to get the actual part. */ function calculateWithdrawalAmount(uint startAmount) public returns (uint){ return startAmount.mul(10).div(100); // 10% } /* * This function calculates the refund amount for the funder. * Due to no floating points in Solidity, we will lose some fidelity. * The funder loses a neglibible amount to refund. * The left over wei gets pooled to the fund. */ function calculateRefundAmount(uint amount, uint withdrawalTimes) public returns (uint) { for(uint i=0; i<withdrawalTimes; i++){ amount = amount.mul(9).div(10); } return amount; } // Getter functions /* * To calculate the refund amount we look at how many times the beneficiary * has withdrawn since the funder added their funds. * We use that deduct 10% for each withdrawal. */ function getRefundAmountForFunder(address addr) public constant returns (uint) { // Only calculate on-the-fly if funder has not been updated if(shouldUpdateFunder(addr)) { uint amount = funders[addr].balance; uint withdrawalTimes = getHowManyWithdrawalsForFunder(addr); return calculateRefundAmount(amount, withdrawalTimes); } else { return funders[addr].balance; } } function getFunderContribution(address funder) public constant returns (uint) { // Only calculate on-the-fly if funder has not been updated if(shouldUpdateFunder(funder)) { uint oldBalance = funders[funder].balance; uint newBalance = getRefundAmountForFunder(funder); uint contribution = oldBalance.sub(newBalance); return funders[funder].contribution.add(contribution); } else { return funders[funder].contribution; } } function getBeneficiary() public constant returns (address) { return beneficiary; } function getCurrentTotalFunders() public constant returns (uint) { return totalCurrentFunders; } function getWithdrawalCounter() public constant returns (uint) { return withdrawalCounter; } function getWithdrawalEntryForFunder(address addr) public constant returns (uint) { return funders[addr].withdrawalEntry; } function getContractBalance() public constant returns (uint256 balance) { balance = this.balance; } function getFunderBalance(address funder) public constant returns (uint256) { return getRefundAmountForFunder(funder); } function getFunderContributionClaimed(address addr) public constant returns (uint) { return funders[addr].contributionClaimed; } function isFunder(address addr) public constant returns (bool) { return funders[addr].exists; } function isTokenized() public constant returns (bool) { return tokenized; } function shouldUpdateFunder(address funder) public constant returns (bool) { return getWithdrawalEntryForFunder(funder) < withdrawalCounter; } function getHowManyWithdrawalsForFunder(address addr) private constant returns (uint) { return withdrawalCounter.sub(getWithdrawalEntryForFunder(addr)); } // State changing functions function setMinimumFundingAmount(uint amount) external onlyByBeneficiary { require(amount > 0); minimumFundingAmount = amount; } function withdraw() external onlyByBeneficiary onlyAfterNextWithdrawalDate onlyWhenLive { // Check uint amount = calculateWithdrawalAmount(this.balance); // Effects withdrawalCounter = withdrawalCounter.add(1); lastWithdrawal = now; // For tracking purposes nextWithdrawal = nextWithdrawal + withdrawalPeriod; // Fixed period increase // Interaction beneficiary.transfer(amount); Withdrawal(amount); } // Refunding by funder // Only funders can refund their own funding // Can only be sent back to the same address it was funded with // We also remove the funder if they succesfully exit with their funds function refund() external onlyByFunder { // Check uint walletBalance = this.balance; uint amount = getRefundAmountForFunder(msg.sender); require(amount > 0); // Effects removeFunder(); // Interaction msg.sender.transfer(amount); Refund(msg.sender, amount); // Make sure this worked as intended assert(this.balance == walletBalance-amount); } // Used when the funder wants to remove themselves as a funder // without refunding. Their eth stays in the pool function removeFunder() public onlyByFunder { delete funders[msg.sender]; totalCurrentFunders = totalCurrentFunders.sub(1); } /* * This is a bookkeeping function which updates the state for the funder * when top up their funds. */ function consolidateFunder(address funder, uint newPayment) private { // Update contribution funders[funder].contribution = getFunderContribution(funder); // Update balance funders[funder].balance = getRefundAmountForFunder(funder).add(newPayment); // Update withdrawal entry funders[funder].withdrawalEntry = withdrawalCounter; } function addTokenization(string tokenName, string tokenSymbol, uint8 tokenDecimals ) external onlyByBeneficiary { require(!isTokenized()); tokenFactory = new MiniMeTokenFactory(); tokenContract = tokenFactory.createCloneToken(0x0, 0, tokenName, tokenDecimals, tokenSymbol, true); tokenized = true; canClaimTokens = true; } function claimTokens() external onlyByFunder onlyWhenTokenized { require(canClaimTokens); uint contributionAmount = getFunderContribution(msg.sender); uint contributionClaimedAmount = getFunderContributionClaimed(msg.sender); // Only claim tokens if they have some left to claim uint claimAmount = contributionAmount.sub(contributionClaimedAmount); require(claimAmount > 0); // Claim tokens funders[msg.sender].contributionClaimed = contributionAmount; tokenContract.generateTokens(msg.sender, claimAmount); TokensClaimed(msg.sender, claimAmount); } /* * The beneficiary can stop/enable funders from claiming more tokens. * This opens up opportunities for tokenizing only happening for a set periods. */ function enableTokenClaiming(bool _enabled) external onlyWhenTokenized onlyByBeneficiary { canClaimTokens = _enabled; } /* --- Sunsetting --- */ /* * The beneficiary can decide to stop using this contract. * They use this sunset function to put it into sunset mode. * The beneficiary can then swipe rest of the funds after a set time * if funders have not withdrawn their funds. */ function sunset() external onlyByBeneficiary onlyWhenLive { sunsetWithdrawDate = now.add(sunsetWithdrawalPeriod); live = false; Sunset(true); } function swipe(address recipient) external onlyWhenSunset onlyByBeneficiary { require(now >= sunsetWithdrawDate); recipient.transfer(this.balance); } /* --- Token Contract Forwarding Controller Functions --- */ /* * Allows beneficiary to call two additional functions on the token contract: * claimTokens * enabledTransfers * */ function tokenContractClaimTokens(address _token) onlyByBeneficiary onlyWhenTokenized { tokenContract.claimTokens(_token); } function tokenContractEnableTransfers(bool _transfersEnabled) onlyByBeneficiary onlyWhenTokenized { tokenContract.enableTransfers(_transfersEnabled); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[],"name":"sunset","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"funders","outputs":[{"name":"exists","type":"bool"},{"name":"balance","type":"uint256"},{"name":"withdrawalEntry","type":"uint256"},{"name":"contribution","type":"uint256"},{"name":"contributionClaimed","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"funder","type":"address"}],"name":"getFunderContribution","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"contractStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"startAmount","type":"uint256"}],"name":"calculateWithdrawalAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"lastWithdrawal","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isFunder","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"withdrawalCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"setMinimumFundingAmount","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getWithdrawalCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sunsetWithdrawalPeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"claimTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokenContract","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getBeneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getCurrentTotalFunders","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokenized","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getContractBalance","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isTokenized","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minimumFundingAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getRefundAmountForFunder","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getWithdrawalEntryForFunder","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_transfersEnabled","type":"bool"}],"name":"tokenContractEnableTransfers","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalCurrentFunders","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"fund","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"nextWithdrawal","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"funder","type":"address"}],"name":"getFunderBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"tokenContractClaimTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"withdrawalPeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"funder","type":"address"}],"name":"shouldUpdateFunder","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"}],"name":"swipe","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"removeFunder","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"withdrawalTimes","type":"uint256"}],"name":"calculateRefundAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenName","type":"string"},{"name":"tokenSymbol","type":"string"},{"name":"tokenDecimals","type":"uint8"}],"name":"addTokenization","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"canClaimTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokenFactory","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_enabled","type":"bool"}],"name":"enableTokenClaiming","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getFunderContributionClaimed","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sunsetWithdrawDate","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"beneficiaryAddress","type":"address"},{"name":"withdrawalPeriodInit","type":"uint256"},{"name":"withdrawalStart","type":"uint256"},{"name":"sunsetWithdrawPeriodInit","type":"uint256"},{"name":"minimumFundingAmountInit","type":"uint256"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"funder","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Payment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"funder","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"funder","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"hasSunset","type":"bool"}],"name":"Sunset","type":"event"}]
Deployed Bytecode
0x606060405236156101f35763ffffffff60e060020a600035041663026164ad81146101ff578063031b3677146102145780630930f6db146102665780630c3d5157146102975780630e1a0399146102bc5780631dd300ce146102e45780631ea488701461030957806320d786b51461033c57806334caa9991461036157806337ea1f631461037957806338af3eed1461039e57806339b8dc40146103cd5780633ccfd60b146103f257806348c54b9d1461040757806354fd4d501461041c57806355a373d614610441578063565a2e2c146104705780635896521b1461049f578063590e1ae3146104c45780636b59f495146104d95780636f9fb98a146105005780637422930114610525578063783c8db01461054c57806383c28ddc14610571578063930c0bba146105a2578063946ad94d146105d3578063957aa58c146105ed578063962ffeae14610614578063b60d4288146101f3578063b7e9f19314610643578063b8b3d85b14610668578063baa61df014610699578063bca7093d146106ba578063cb6e3fa9146106df578063cce7db5814610712578063cfd32aa014610733578063d3d5549314610748578063dc30f91214610773578063e22a3af8146107a5578063e77772fe146107cc578063e7cf0171146107fb578063e8f3cd5914610815578063fa2e9db814610846575b5b6101fc61086b565b5b005b341561020a57600080fd5b6101fc61097d565b005b341561021f57600080fd5b610233600160a060020a0360043516610a05565b604051941515855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b341561027157600080fd5b610285600160a060020a0360043516610a39565b60405190815260200160405180910390f35b34156102a257600080fd5b610285610ae5565b60405190815260200160405180910390f35b34156102c757600080fd5b610285600435610aeb565b60405190815260200160405180910390f35b34156102ef57600080fd5b610285610b17565b60405190815260200160405180910390f35b341561031457600080fd5b610328600160a060020a0360043516610b1d565b604051901515815260200160405180910390f35b341561034757600080fd5b610285610b3f565b60405190815260200160405180910390f35b341561036c57600080fd5b6101fc600435610b45565b005b341561038457600080fd5b610285610b77565b60405190815260200160405180910390f35b34156103a957600080fd5b6103b1610b7e565b604051600160a060020a03909116815260200160405180910390f35b34156103d857600080fd5b610285610b8d565b60405190815260200160405180910390f35b34156103fd57600080fd5b6101fc610b93565b005b341561041257600080fd5b6101fc610c7b565b005b341561042757600080fd5b610285610dcd565b60405190815260200160405180910390f35b341561044c57600080fd5b6103b1610dd3565b604051600160a060020a03909116815260200160405180910390f35b341561047b57600080fd5b6103b1610de2565b604051600160a060020a03909116815260200160405180910390f35b34156104aa57600080fd5b610285610df2565b60405190815260200160405180910390f35b34156104cf57600080fd5b6101fc610df9565b005b34156104e457600080fd5b610328610ec6565b604051901515815260200160405180910390f35b341561050b57600080fd5b610285610ee7565b60405190815260200160405180910390f35b341561053057600080fd5b610328610ef6565b604051901515815260200160405180910390f35b341561055757600080fd5b610285610f18565b60405190815260200160405180910390f35b341561057c57600080fd5b610285600160a060020a0360043516610f1e565b60405190815260200160405180910390f35b34156105ad57600080fd5b610285600160a060020a0360043516610f94565b60405190815260200160405180910390f35b34156105de57600080fd5b6101fc6004351515610fb6565b005b34156105f857600080fd5b610328611046565b604051901515815260200160405180910390f35b341561061f57600080fd5b61028561104f565b60405190815260200160405180910390f35b6101fc61086b565b005b341561064e57600080fd5b610285611055565b60405190815260200160405180910390f35b341561067357600080fd5b610285600160a060020a036004351661105b565b60405190815260200160405180910390f35b34156106a457600080fd5b6101fc600160a060020a036004351661106e565b005b34156106c557600080fd5b610285611106565b60405190815260200160405180910390f35b34156106ea57600080fd5b610328600160a060020a036004351661110c565b604051901515815260200160405180910390f35b341561071d57600080fd5b6101fc600160a060020a0360043516611123565b005b341561073e57600080fd5b6101fc6111a0565b005b341561075357600080fd5b61028560043560243561120c565b60405190815260200160405180910390f35b341561077e57600080fd5b6101fc602460048035828101929082013591813591820191013560ff60443516611250565b005b34156107b057600080fd5b610328611420565b604051901515815260200160405180910390f35b34156107d757600080fd5b6103b1611430565b604051600160a060020a03909116815260200160405180910390f35b341561080657600080fd5b6101fc600435151561143f565b005b341561082057600080fd5b610285600160a060020a036004351661149c565b60405190815260200160405180910390f35b341561085157600080fd5b6102856114be565b60405190815260200160405180910390f35b60025460ff16151561087c57600080fd5b600b5434101561088b57600080fd5b61089433610b1d565b1515610931576003546108ae90600163ffffffff6114c416565b60035560a060405190810160409081526001808352346020808501919091526004548385015260006060850181905260808501819052600160a060020a0333168152919052208151815460ff191690151517815560208201518160010155604082015181600201556060820151816003015560808201516004909101555061093b565b61093b33346114de565b5b33600160a060020a03167fd4f43975feb89f48dd30cabbb32011045be187d1e11c8ea9faa43efc352825193460405190815260200160405180910390a25b5b565b60085433600160a060020a0390811691161461099857600080fd5b60025460ff1615156109a957600080fd5b6009546109bd90429063ffffffff6114c416565b6005556002805460ff191690557fcd62b3824d2183ae05f654408a9f8a5768f44218ec6eea3722d91b9405d2757e6001604051901515815260200160405180910390a15b5b5b565b60016020819052600091825260409091208054918101546002820154600383015460049093015460ff909416939192909185565b600080600080610a488561110c565b15610abd57600160a060020a038516600090815260016020819052604090912001549250610a7585610f1e565b9150610a87838363ffffffff61154c16565b600160a060020a038616600090815260016020526040902060030154909150610ab6908263ffffffff6114c416565b9350610adc565b600160a060020a03851660009081526001602052604090206003015493505b5b505050919050565b600e5481565b6000610b0f6064610b0384600a63ffffffff61156316565b9063ffffffff61159216565b90505b919050565b600c5481565b600160a060020a03811660009081526001602052604090205460ff165b919050565b60045481565b60085433600160a060020a03908116911614610b6057600080fd5b60008111610b6d57600080fd5b600b8190555b5b50565b6004545b90565b600854600160a060020a031681565b60095481565b60085460009033600160a060020a03908116911614610bb157600080fd5b600d54421015610bc057600080fd5b60025460ff161515610bd157600080fd5b610be430600160a060020a031631610aeb565b600454909150610bfb90600163ffffffff6114c416565b60045542600c55600a54600d80549091019055600854600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610c4157600080fd5b7f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de78160405190815260200160405180910390a15b5b5b5b50565b6000806000610c8933610b1d565b1515610c9457600080fd5b610c9c610ef6565b1515610ca757600080fd5b60075460a860020a900460ff161515610cbf57600080fd5b610cc833610a39565b9250610cd33361149c565b9150610ce5838363ffffffff61154c16565b905060008111610cf457600080fd5b600160a060020a03338181166000908152600160205260408082206004018790556006549093169263827f32c092918591516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d6d57600080fd5b6102c65a03f11515610d7e57600080fd5b50505060405180515050600160a060020a0333167f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e4308260405190815260200160405180910390a25b5b5b505050565b60005481565b600654600160a060020a031681565b600854600160a060020a03165b90565b6003545b90565b600080610e0533610b1d565b1515610e1057600080fd5b30600160a060020a0316319150610e2633610f1e565b905060008111610e3557600080fd5b610e3d6111a0565b600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610e6e57600080fd5b33600160a060020a03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8260405190815260200160405180910390a2600160a060020a0330163181830314610ec057fe5b5b5b5050565b60075474010000000000000000000000000000000000000000900460ff1681565b600160a060020a033016315b90565b60075474010000000000000000000000000000000000000000900460ff165b90565b600b5481565b6000806000610f2c8461110c565b15610f6c57600160a060020a038416600090815260016020819052604090912001549150610f59846115ae565b9050610f65828261120c565b9250610f8c565b600160a060020a0384166000908152600160208190526040909120015492505b5b5050919050565b600160a060020a0381166000908152600160205260409020600201545b919050565b60085433600160a060020a03908116911614610fd157600080fd5b610fd9610ef6565b1515610fe457600080fd5b600654600160a060020a031663f41e60c58260405160e060020a63ffffffff84160281529015156004820152602401600060405180830381600087803b151561102c57600080fd5b6102c65a03f1151561103d57600080fd5b5050505b5b5b50565b60025460ff1681565b60035481565b600d5481565b6000610b0f82610f1e565b90505b919050565b60085433600160a060020a0390811691161461108957600080fd5b611091610ef6565b151561109c57600080fd5b600654600160a060020a031663df8de3e78260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561102c57600080fd5b6102c65a03f1151561103d57600080fd5b5050505b5b5b50565b600a5481565b600060045461111a83610f94565b1090505b919050565b60025460ff161561113357600080fd5b60085433600160a060020a0390811691161461114e57600080fd5b60055442101561115d57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515610b7357600080fd5b5b5b5b50565b6111a933610b1d565b15156111b457600080fd5b600160a060020a03331660009081526001602081905260408220805460ff1916815580820183905560028101839055600380820184905560049091019290925590546112059163ffffffff61154c16565b6003555b5b565b6000805b828110156112455761123a600a610b0386600963ffffffff61156316565b9063ffffffff61159216565b93505b600101611210565b8391505b5092915050565b60085433600160a060020a0390811691161461126b57600080fd5b611273610ef6565b1561127d57600080fd5b6112856115d3565b604051809103906000f080151561129b57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03928316179081905516635b7b72c160008088888689896001866040516020015260405160e060020a63ffffffff8b16028152600160a060020a038916600482019081526024820189905260ff8616606483015282151560a483015260c06044830190815260c483018890529091608481019060e4018989808284379091018481038352868152602001905086868082843782019150509a5050505050505050505050602060405180830381600087803b151561137957600080fd5b6102c65a03f1151561138a57600080fd5b505050604051805160068054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff19909216919091179055506007805475ff0000000000000000000000000000000000000000001974ff00000000000000000000000000000000000000001990911674010000000000000000000000000000000000000000171660a860020a1790555b5b5050505050565b60075460a860020a900460ff1681565b600754600160a060020a031681565b611447610ef6565b151561145257600080fd5b60085433600160a060020a0390811691161461146d57600080fd5b6007805475ff000000000000000000000000000000000000000000191660a860020a831515021790555b5b5b50565b600160a060020a0381166000908152600160205260409020600401545b919050565b60055481565b6000828201838110156114d357fe5b8091505b5092915050565b6114e782610a39565b600160a060020a03831660009081526001602052604090206003015561151c8161151084610f1e565b9063ffffffff6114c416565b600160a060020a0383166000908152600160208190526040909120908101919091556004546002909101555b5050565b60008282111561155857fe5b508082035b92915050565b600082820283158061157f575082848281151561157c57fe5b04145b15156114d357fe5b8091505b5092915050565b60008082848115156115a057fe5b0490508091505b5092915050565b6000610b0f6115bc83610f94565b6004549063ffffffff61154c16565b90505b919050565b604051611e94806115e48339019056006060604052341561000f57600080fd5b5b611e758061001f6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635b7b72c1811461003d575b600080fd5b341561004857600080fd5b6101016004803573ffffffffffffffffffffffffffffffffffffffff169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803560ff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050505091351515915061012a9050565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000803088888888888861013c610310565b73ffffffffffffffffffffffffffffffffffffffff8089168252871660208201526040810186905260ff8416608082015281151560c082015260e0606082018181529060a0830190830187818151815260200191508051906020019080838360005b838110156101b75780820151818401525b60200161019e565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561021b5780820151818401525b602001610202565b50505050905090810190601f1680156102485780820380516001836020036101000a031916815260200191505b509950505050505050505050604051809103906000f080151561026a57600080fd5b90508073ffffffffffffffffffffffffffffffffffffffff16633cebb823336040517c010000000000000000000000000000000000000000000000000000000063ffffffff841602815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401600060405180830381600087803b15156102ed57600080fd5b6102c65a03f115156102fe57600080fd5b5050508091505b509695505050505050565b604051611b2980610321833901905600606060405260408051908101604052600781527f4d4d545f302e3200000000000000000000000000000000000000000000000000602082015260049080516200004d9291602001906200015c565b5034156200005a57600080fd5b60405162001b2938038062001b2983398101604052808051919060200180519190602001805191906020018051820191906020018051919060200180518201919060200180519150505b5b60008054600160a060020a03191633600160a060020a03161790555b600b805461010060a860020a031916610100600160a060020a038a16021790556001848051620000f69291602001906200015c565b506002805460ff191660ff851617905560038280516200011b9291602001906200015c565b5060058054600160a060020a031916600160a060020a0388161790556006859055600b805460ff1916821515179055436007555b5050505050505062000206565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200019f57805160ff1916838001178555620001cf565b82800160010185558215620001cf579182015b82811115620001cf578251825591602001919060010190620001b2565b5b50620001de929150620001e2565b5090565b6200020391905b80821115620001de5760008155600101620001e9565b5090565b90565b61191380620002166000396000f3006060604052361561012d5763ffffffff60e060020a60003504166306fdde038114610131578063095ea7b3146101bc57806317634514146101f257806318160ddd1461021757806323b872dd1461023c578063313ce567146102785780633cebb823146102a15780634ee2cd7e146102c257806354fd4d50146102f65780636638c0871461038157806370a082311461044557806380a5400114610476578063827f32c0146104a557806395d89b41146104db578063981b24d014610566578063a9059cbb1461058e578063bef97c87146105c4578063c5bcc4f1146105eb578063cae9ca5114610610578063d3ce77fe14610689578063dd62ed3e146106bf578063df8de3e7146106f6578063e77772fe14610717578063f41e60c514610746578063f77c479114610760575b5b5b005b341561013c57600080fd5b61014461078f565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101815780820151818401525b602001610168565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101de600160a060020a036004351660243561082d565b604051901515815260200160405180910390f35b34156101fd57600080fd5b6102056108e6565b60405190815260200160405180910390f35b341561022257600080fd5b6102056108ec565b60405190815260200160405180910390f35b341561024757600080fd5b6101de600160a060020a03600435811690602435166044356108fd565b604051901515815260200160405180910390f35b341561028357600080fd5b61028b61099f565b60405160ff909116815260200160405180910390f35b34156102ac57600080fd5b61012d600160a060020a03600435166109a8565b005b34156102cd57600080fd5b610205600160a060020a03600435166024356109f0565b60405190815260200160405180910390f35b341561030157600080fd5b610144610b36565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101815780820151818401525b602001610168565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561038c57600080fd5b61042960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803560ff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650508435946020013515159350610bd492505050565b604051600160a060020a03909116815260200160405180910390f35b341561045057600080fd5b610205600160a060020a0360043516610e04565b60405190815260200160405180910390f35b341561048157600080fd5b610429610e18565b604051600160a060020a03909116815260200160405180910390f35b34156104b057600080fd5b6101de600160a060020a0360043516602435610e27565b604051901515815260200160405180910390f35b34156104e657600080fd5b610144610efa565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101815780820151818401525b602001610168565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057157600080fd5b610205600435610f98565b60405190815260200160405180910390f35b341561059957600080fd5b6101de600160a060020a0360043516602435611090565b604051901515815260200160405180910390f35b34156105cf57600080fd5b6101de6110b8565b604051901515815260200160405180910390f35b34156105f657600080fd5b6102056110c1565b60405190815260200160405180910390f35b341561061b57600080fd5b6101de60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506110c795505050505050565b604051901515815260200160405180910390f35b341561069457600080fd5b6101de600160a060020a03600435166024356111e5565b604051901515815260200160405180910390f35b34156106ca57600080fd5b610205600160a060020a03600435811690602435166112b2565b60405190815260200160405180910390f35b341561070157600080fd5b61012d600160a060020a03600435166112df565b005b341561072257600080fd5b61042961148c565b604051600160a060020a03909116815260200160405180910390f35b341561075157600080fd5b61012d60043515156114a0565b005b341561076b57600080fd5b6104296114ce565b604051600160a060020a03909116815260200160405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108255780601f106107fa57610100808354040283529160200191610825565b820191906000526020600020905b81548152906001019060200180831161080857829003601f168201915b505050505081565b600b5460009060ff16151561084157600080fd5b8115806108715750600160a060020a03338116600090815260096020908152604080832093871683529290522054155b151561087c57600080fd5b600160a060020a03338116600081815260096020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60075481565b60006108f743610f98565b90505b90565b6000805433600160a060020a0390811691161461098a57600b5460ff16151561092557600080fd5b600160a060020a03808516600090815260096020908152604080832033909416835292905220548290101561095c57506000610998565b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390555b6109958484846114dd565b90505b9392505050565b60025460ff1681565b60005433600160a060020a039081169116146109c357600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600860205260408120541580610a505750600160a060020a038316600090815260086020526040812080548492908110610a3557fe5b906000526020600020900160005b50546001608060020a0316115b15610b0657600554600160a060020a031615610af957600554600654600160a060020a0390911690634ee2cd7e908590610a8b90869061160b565b60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ad757600080fd5b6102c65a03f11515610ae857600080fd5b5050506040518051905090506108e0565b5060006108e0565b6108e0565b600160a060020a0383166000908152600860205260409020610b289083611625565b90506108e0565b5b92915050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108255780601f106107fa57610100808354040283529160200191610825565b820191906000526020600020905b81548152906001019060200180831161080857829003601f168201915b505050505081565b600080831515610be2574393505b600b546101009004600160a060020a0316635b7b72c130868a8a8a8960006040516020015260405160e060020a63ffffffff8916028152600160a060020a038716600482019081526024820187905260ff8516606483015282151560a483015260c0604483019081529091608481019060c40187818151815260200191508051906020019080838360005b83811015610c865780820151818401525b602001610c6d565b50505050905090810190601f168015610cb35780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610cea5780820151818401525b602001610cd1565b50505050905090810190601f168015610d175780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1515610d3b57600080fd5b6102c65a03f11515610d4c57600080fd5b5050506040518051915050600160a060020a038116633cebb8233360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610da557600080fd5b6102c65a03f11515610db657600080fd5b50505080600160a060020a03167f086c875b377f900b07ce03575813022f05dd10ed7640b5282cf6d3c3fc352ade8560405190815260200160405180910390a28091505b5095945050505050565b6000610e1082436109f0565b90505b919050565b600554600160a060020a031681565b600080548190819033600160a060020a03908116911614610e4757600080fd5b610e4f6108ec565b915083820182901015610e6157600080fd5b610e6a85610e04565b905083810181901015610e7c57600080fd5b610e89600a858401611799565b600160a060020a0385166000908152600860205260409020610ead90828601611799565b84600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405190815260200160405180910390a3600192505b5b505092915050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108255780601f106107fa57610100808354040283529160200191610825565b820191906000526020600020905b81548152906001019060200180831161080857829003601f168201915b505050505081565b600a546000901580610fd1575081600a6000815481101515610fb657fe5b906000526020600020900160005b50546001608060020a0316115b1561107857600554600160a060020a03161561106b57600554600654600160a060020a039091169063981b24d09061100a90859061160b565b60006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561104957600080fd5b6102c65a03f1151561105a57600080fd5b505050604051805190509050610e13565b506000610e13565b610e13565b611083600a83611625565b9050610e13565b5b919050565b600b5460009060ff1615156110a457600080fd5b6110af3384846114dd565b90505b92915050565b600b5460ff1681565b60065481565b60006110d3848461082d565b15156110de57600080fd5b83600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111775780820151818401525b60200161115e565b50505050905090810190601f1680156111a45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156111c557600080fd5b6102c65a03f115156111d657600080fd5b505050600190505b9392505050565b600080548190819033600160a060020a0390811691161461120557600080fd5b61120d6108ec565b91508382101561121c57600080fd5b61122585610e04565b90508381101561123457600080fd5b611241600a858403611799565b600160a060020a038516600090815260086020526040902061126590858303611799565b600085600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405190815260200160405180910390a3600192505b5b505092915050565b600160a060020a038083166000908152600960209081526040808320938516835292905220545b92915050565b60008054819033600160a060020a039081169116146112fd57600080fd5b600160a060020a038316151561134b57600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561134657600080fd5b611486565b82915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156113a557600080fd5b6102c65a03f115156113b657600080fd5b505050604051805160008054919350600160a060020a03808616935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561142657600080fd5b6102c65a03f1151561143757600080fd5b50505060405180515050600054600160a060020a039081169084167ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c8360405190815260200160405180910390a35b5b505050565b600b546101009004600160a060020a031681565b60005433600160a060020a039081169116146114bb57600080fd5b600b805460ff19168215151790555b5b50565b600054600160a060020a031681565b600080808315156114f15760019250611602565b60065443901061150057600080fd5b600160a060020a0385161580159061152a575030600160a060020a031685600160a060020a031614155b151561153557600080fd5b61153f86436109f0565b9150838210156115525760009250611602565b600160a060020a038616600090815260086020526040902061157690858403611799565b61158085436109f0565b90508381018190101561159257600080fd5b600160a060020a03851660009081526008602052604090206115b690828601611799565b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405190815260200160405180910390a3600192505b50509392505050565b600081831061161a57816110af565b825b90505b92915050565b6000806000808580549050600014156116415760009350611790565b85548690600019810190811061165357fe5b906000526020600020900160005b50546001608060020a031685106116b85785548690600019810190811061168457fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a03169350611790565b8560008154811015156116c757fe5b906000526020600020900160005b50546001608060020a03168510156116f05760009350611790565b8554600093506000190191505b828211156117525760026001838501015b04905084868281548110151561172057fe5b906000526020600020900160005b50546001608060020a0316116117465780925061174d565b6001810391505b6116fd565b858381548110151561176057fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806117d6575083544390859060001981019081106117bb57fe5b906000526020600020900160005b50546001608060020a0316105b1561184c57835484906117ec826001830161189c565b815481106117f657fe5b906000526020600020900160005b5080546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff1990931692909217161781559150611895565b83548490600019810190811061185e57fe5b906000526020600020900160005b5080546001608060020a0380861670010000000000000000000000000000000002911617815590505b5b50505050565b815481835581811511611486576000838152602090206114869181019083016118c6565b5b505050565b6108fa91905b808211156118e057600081556001016118cc565b5090565b905600a165627a7a723058208ef941e0bb175213784d6553e8f1f3d1dc1846f5bb89ca86f342dfd688c343770029a165627a7a7230582024f1a5920e4554110881584c0d377664cbce483f0c468821a2a6e93594d1c54b0029a165627a7a723058200c8794fe697548acb1de53492b09424a2522ea0c1d55906a52eeb6be46424e480029
Swarm Source
bzzr://0c8794fe697548acb1de53492b09424a2522ea0c1d55906a52eeb6be46424e48
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.