Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 7 from a total of 7 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Discount Str... | 8178745 | 2011 days ago | IN | 0 ETH | 0.00019023 | ||||
Add Discount Str... | 7461268 | 2123 days ago | IN | 0 ETH | 0.00056985 | ||||
Add Discount Str... | 6848979 | 2233 days ago | IN | 0 ETH | 0.0007579 | ||||
Add Discount Str... | 6848937 | 2233 days ago | IN | 0 ETH | 0.00015673 | ||||
Add Discount Str... | 6848929 | 2233 days ago | IN | 0 ETH | 0.00012538 | ||||
Add Discount Str... | 6713116 | 2256 days ago | IN | 0 ETH | 0.00122092 | ||||
Set Crowdsale | 6439241 | 2301 days ago | IN | 0 ETH | 0.00097844 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
DiscountStructs
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-09-27 */ pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure 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 a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } contract Staff is Ownable, RBAC { string public constant ROLE_STAFF = "staff"; function addStaff(address _staff) public onlyOwner { addRole(_staff, ROLE_STAFF); } function removeStaff(address _staff) public onlyOwner { removeRole(_staff, ROLE_STAFF); } function isStaff(address _staff) view public returns (bool) { return hasRole(_staff, ROLE_STAFF); } } contract StaffUtil { Staff public staffContract; constructor (Staff _staffContract) public { require(msg.sender == _staffContract.owner()); staffContract = _staffContract; } modifier onlyOwner() { require(msg.sender == staffContract.owner()); _; } modifier onlyOwnerOrStaff() { require(msg.sender == staffContract.owner() || staffContract.isStaff(msg.sender)); _; } } contract Crowdsale is StaffUtil { using SafeMath for uint256; Token tokenContract; PromoCodes promoCodesContract; DiscountPhases discountPhasesContract; DiscountStructs discountStructsContract; address ethFundsWallet; uint256 referralBonusPercent; uint256 startDate; uint256 crowdsaleStartDate; uint256 endDate; uint256 tokenDecimals; uint256 tokenRate; uint256 tokensForSaleCap; uint256 minPurchaseInWei; uint256 maxInvestorContributionInWei; bool paused; bool finalized; uint256 weiRaised; uint256 soldTokens; uint256 bonusTokens; uint256 sentTokens; uint256 claimedSoldTokens; uint256 claimedBonusTokens; uint256 claimedSentTokens; uint256 purchasedTokensClaimDate; uint256 bonusTokensClaimDate; mapping(address => Investor) public investors; enum InvestorStatus {UNDEFINED, WHITELISTED, BLOCKED} struct Investor { InvestorStatus status; uint256 contributionInWei; uint256 purchasedTokens; uint256 bonusTokens; uint256 referralTokens; uint256 receivedTokens; TokensPurchase[] tokensPurchases; bool isBlockpass; } struct TokensPurchase { uint256 value; uint256 amount; uint256 bonus; address referrer; uint256 referrerSentAmount; } event InvestorWhitelisted(address indexed investor, uint timestamp, address byStaff); event InvestorBlocked(address indexed investor, uint timestamp, address byStaff); event TokensPurchased( address indexed investor, uint indexed purchaseId, uint256 value, uint256 purchasedAmount, uint256 promoCodeAmount, uint256 discountPhaseAmount, uint256 discountStructAmount, address indexed referrer, uint256 referrerSentAmount, uint timestamp ); event TokensPurchaseRefunded( address indexed investor, uint indexed purchaseId, uint256 value, uint256 amount, uint256 bonus, uint timestamp, address byStaff ); event Paused(uint timestamp, address byStaff); event Resumed(uint timestamp, address byStaff); event Finalized(uint timestamp, address byStaff); event TokensSent(address indexed investor, uint256 amount, uint timestamp, address byStaff); event PurchasedTokensClaimLocked(uint date, uint timestamp, address byStaff); event PurchasedTokensClaimUnlocked(uint timestamp, address byStaff); event BonusTokensClaimLocked(uint date, uint timestamp, address byStaff); event BonusTokensClaimUnlocked(uint timestamp, address byStaff); event CrowdsaleStartDateUpdated(uint date, uint timestamp, address byStaff); event EndDateUpdated(uint date, uint timestamp, address byStaff); event MinPurchaseChanged(uint256 minPurchaseInWei, uint timestamp, address byStaff); event MaxInvestorContributionChanged(uint256 maxInvestorContributionInWei, uint timestamp, address byStaff); event TokenRateChanged(uint newRate, uint timestamp, address byStaff); event TokensClaimed( address indexed investor, uint256 purchased, uint256 bonus, uint256 referral, uint256 received, uint timestamp, address byStaff ); event TokensBurned(uint256 amount, uint timestamp, address byStaff); constructor ( uint256[11] uint256Args, address[5] addressArgs ) StaffUtil(Staff(addressArgs[4])) public { // uint256 args startDate = uint256Args[0]; crowdsaleStartDate = uint256Args[1]; endDate = uint256Args[2]; tokenDecimals = uint256Args[3]; tokenRate = uint256Args[4]; tokensForSaleCap = uint256Args[5]; minPurchaseInWei = uint256Args[6]; maxInvestorContributionInWei = uint256Args[7]; purchasedTokensClaimDate = uint256Args[8]; bonusTokensClaimDate = uint256Args[9]; referralBonusPercent = uint256Args[10]; // address args ethFundsWallet = addressArgs[0]; promoCodesContract = PromoCodes(addressArgs[1]); discountPhasesContract = DiscountPhases(addressArgs[2]); discountStructsContract = DiscountStructs(addressArgs[3]); require(startDate < crowdsaleStartDate); require(crowdsaleStartDate < endDate); require(tokenDecimals > 0); require(tokenRate > 0); require(tokensForSaleCap > 0); require(minPurchaseInWei <= maxInvestorContributionInWei); require(ethFundsWallet != address(0)); } function getState() external view returns (bool[2] boolArgs, uint256[18] uint256Args, address[6] addressArgs) { boolArgs[0] = paused; boolArgs[1] = finalized; uint256Args[0] = weiRaised; uint256Args[1] = soldTokens; uint256Args[2] = bonusTokens; uint256Args[3] = sentTokens; uint256Args[4] = claimedSoldTokens; uint256Args[5] = claimedBonusTokens; uint256Args[6] = claimedSentTokens; uint256Args[7] = purchasedTokensClaimDate; uint256Args[8] = bonusTokensClaimDate; uint256Args[9] = startDate; uint256Args[10] = crowdsaleStartDate; uint256Args[11] = endDate; uint256Args[12] = tokenRate; uint256Args[13] = tokenDecimals; uint256Args[14] = minPurchaseInWei; uint256Args[15] = maxInvestorContributionInWei; uint256Args[16] = referralBonusPercent; uint256Args[17] = getTokensForSaleCap(); addressArgs[0] = staffContract; addressArgs[1] = ethFundsWallet; addressArgs[2] = promoCodesContract; addressArgs[3] = discountPhasesContract; addressArgs[4] = discountStructsContract; addressArgs[5] = tokenContract; } function fitsTokensForSaleCap(uint256 _amount) public view returns (bool) { return getDistributedTokens().add(_amount) <= getTokensForSaleCap(); } function getTokensForSaleCap() public view returns (uint256) { if (tokenContract != address(0)) { return tokenContract.balanceOf(this); } return tokensForSaleCap; } function getDistributedTokens() public view returns (uint256) { return soldTokens.sub(claimedSoldTokens).add(bonusTokens.sub(claimedBonusTokens)).add(sentTokens.sub(claimedSentTokens)); } function setTokenContract(Token token) external onlyOwner { require(token.balanceOf(this) >= 0); require(tokenContract == address(0)); require(token != address(0)); tokenContract = token; } function getInvestorClaimedTokens(address _investor) external view returns (uint256) { if (tokenContract != address(0)) { return tokenContract.balanceOf(_investor); } return 0; } function isBlockpassInvestor(address _investor) external constant returns (bool) { return investors[_investor].status == InvestorStatus.WHITELISTED && investors[_investor].isBlockpass; } function whitelistInvestor(address _investor, bool _isBlockpass) external onlyOwnerOrStaff { require(_investor != address(0)); require(investors[_investor].status != InvestorStatus.WHITELISTED); investors[_investor].status = InvestorStatus.WHITELISTED; investors[_investor].isBlockpass = _isBlockpass; emit InvestorWhitelisted(_investor, now, msg.sender); } function bulkWhitelistInvestor(address[] _investors) external onlyOwnerOrStaff { for (uint256 i = 0; i < _investors.length; i++) { if (_investors[i] != address(0) && investors[_investors[i]].status != InvestorStatus.WHITELISTED) { investors[_investors[i]].status = InvestorStatus.WHITELISTED; emit InvestorWhitelisted(_investors[i], now, msg.sender); } } } function blockInvestor(address _investor) external onlyOwnerOrStaff { require(_investor != address(0)); require(investors[_investor].status != InvestorStatus.BLOCKED); investors[_investor].status = InvestorStatus.BLOCKED; emit InvestorBlocked(_investor, now, msg.sender); } function lockPurchasedTokensClaim(uint256 _date) external onlyOwner { require(_date > now); purchasedTokensClaimDate = _date; emit PurchasedTokensClaimLocked(_date, now, msg.sender); } function unlockPurchasedTokensClaim() external onlyOwner { purchasedTokensClaimDate = now; emit PurchasedTokensClaimUnlocked(now, msg.sender); } function lockBonusTokensClaim(uint256 _date) external onlyOwner { require(_date > now); bonusTokensClaimDate = _date; emit BonusTokensClaimLocked(_date, now, msg.sender); } function unlockBonusTokensClaim() external onlyOwner { bonusTokensClaimDate = now; emit BonusTokensClaimUnlocked(now, msg.sender); } function setCrowdsaleStartDate(uint256 _date) external onlyOwner { crowdsaleStartDate = _date; emit CrowdsaleStartDateUpdated(_date, now, msg.sender); } function setEndDate(uint256 _date) external onlyOwner { endDate = _date; emit EndDateUpdated(_date, now, msg.sender); } function setMinPurchaseInWei(uint256 _minPurchaseInWei) external onlyOwner { minPurchaseInWei = _minPurchaseInWei; emit MinPurchaseChanged(_minPurchaseInWei, now, msg.sender); } function setMaxInvestorContributionInWei(uint256 _maxInvestorContributionInWei) external onlyOwner { require(minPurchaseInWei <= _maxInvestorContributionInWei); maxInvestorContributionInWei = _maxInvestorContributionInWei; emit MaxInvestorContributionChanged(_maxInvestorContributionInWei, now, msg.sender); } function changeTokenRate(uint256 _tokenRate) external onlyOwner { require(_tokenRate > 0); tokenRate = _tokenRate; emit TokenRateChanged(_tokenRate, now, msg.sender); } function buyTokens(bytes32 _promoCode, address _referrer) external payable { require(!finalized); require(!paused); require(startDate < now); require(investors[msg.sender].status == InvestorStatus.WHITELISTED); require(msg.value > 0); require(msg.value >= minPurchaseInWei); require(investors[msg.sender].contributionInWei.add(msg.value) <= maxInvestorContributionInWei); // calculate purchased amount uint256 purchasedAmount; if (tokenDecimals > 18) { purchasedAmount = msg.value.mul(tokenRate).mul(10 ** (tokenDecimals - 18)); } else if (tokenDecimals < 18) { purchasedAmount = msg.value.mul(tokenRate).div(10 ** (18 - tokenDecimals)); } else { purchasedAmount = msg.value.mul(tokenRate); } // calculate total amount, this includes promo code amount or discount phase amount uint256 promoCodeBonusAmount = promoCodesContract.applyBonusAmount(msg.sender, purchasedAmount, _promoCode); uint256 discountPhaseBonusAmount = discountPhasesContract.calculateBonusAmount(purchasedAmount); uint256 discountStructBonusAmount = discountStructsContract.getBonus(msg.sender, purchasedAmount, msg.value); uint256 bonusAmount = promoCodeBonusAmount.add(discountPhaseBonusAmount).add(discountStructBonusAmount); // update referrer's referral tokens uint256 referrerBonusAmount; address referrerAddr; if ( _referrer != address(0) && msg.sender != _referrer && investors[_referrer].status == InvestorStatus.WHITELISTED ) { referrerBonusAmount = purchasedAmount * referralBonusPercent / 100; referrerAddr = _referrer; } // check that calculated tokens will not exceed tokens for sale cap require(fitsTokensForSaleCap(purchasedAmount.add(bonusAmount).add(referrerBonusAmount))); // update crowdsale total amount of capital raised weiRaised = weiRaised.add(msg.value); soldTokens = soldTokens.add(purchasedAmount); bonusTokens = bonusTokens.add(bonusAmount).add(referrerBonusAmount); // update referrer's bonus tokens investors[referrerAddr].referralTokens = investors[referrerAddr].referralTokens.add(referrerBonusAmount); // update investor's purchased tokens investors[msg.sender].purchasedTokens = investors[msg.sender].purchasedTokens.add(purchasedAmount); // update investor's bonus tokens investors[msg.sender].bonusTokens = investors[msg.sender].bonusTokens.add(bonusAmount); // update investor's tokens eth value investors[msg.sender].contributionInWei = investors[msg.sender].contributionInWei.add(msg.value); // update investor's tokens purchases uint tokensPurchasesLength = investors[msg.sender].tokensPurchases.push(TokensPurchase({ value : msg.value, amount : purchasedAmount, bonus : bonusAmount, referrer : referrerAddr, referrerSentAmount : referrerBonusAmount }) ); // log investor's tokens purchase emit TokensPurchased( msg.sender, tokensPurchasesLength - 1, msg.value, purchasedAmount, promoCodeBonusAmount, discountPhaseBonusAmount, discountStructBonusAmount, referrerAddr, referrerBonusAmount, now ); // forward eth to funds wallet require(ethFundsWallet.call.gas(300000).value(msg.value)()); } function sendTokens(address _investor, uint256 _amount) external onlyOwner { require(investors[_investor].status == InvestorStatus.WHITELISTED); require(_amount > 0); require(fitsTokensForSaleCap(_amount)); // update crowdsale total amount of capital raised sentTokens = sentTokens.add(_amount); // update investor's received tokens balance investors[_investor].receivedTokens = investors[_investor].receivedTokens.add(_amount); // log tokens sent action emit TokensSent( _investor, _amount, now, msg.sender ); } function burnUnsoldTokens() external onlyOwner { require(tokenContract != address(0)); require(finalized); uint256 tokensToBurn = tokenContract.balanceOf(this).sub(getDistributedTokens()); require(tokensToBurn > 0); tokenContract.burn(tokensToBurn); // log tokens burned action emit TokensBurned(tokensToBurn, now, msg.sender); } function claimTokens() external { require(tokenContract != address(0)); require(!paused); require(investors[msg.sender].status == InvestorStatus.WHITELISTED); uint256 clPurchasedTokens; uint256 clReceivedTokens; uint256 clBonusTokens_; uint256 clRefTokens; require(purchasedTokensClaimDate < now || bonusTokensClaimDate < now); { uint256 purchasedTokens = investors[msg.sender].purchasedTokens; uint256 receivedTokens = investors[msg.sender].receivedTokens; if (purchasedTokensClaimDate < now && (purchasedTokens > 0 || receivedTokens > 0)) { investors[msg.sender].contributionInWei = 0; investors[msg.sender].purchasedTokens = 0; investors[msg.sender].receivedTokens = 0; claimedSoldTokens = claimedSoldTokens.add(purchasedTokens); claimedSentTokens = claimedSentTokens.add(receivedTokens); // free up storage used by transaction delete (investors[msg.sender].tokensPurchases); clPurchasedTokens = purchasedTokens; clReceivedTokens = receivedTokens; tokenContract.transfer(msg.sender, purchasedTokens.add(receivedTokens)); } } { uint256 bonusTokens_ = investors[msg.sender].bonusTokens; uint256 refTokens = investors[msg.sender].referralTokens; if (bonusTokensClaimDate < now && (bonusTokens_ > 0 || refTokens > 0)) { investors[msg.sender].bonusTokens = 0; investors[msg.sender].referralTokens = 0; claimedBonusTokens = claimedBonusTokens.add(bonusTokens_).add(refTokens); clBonusTokens_ = bonusTokens_; clRefTokens = refTokens; tokenContract.transfer(msg.sender, bonusTokens_.add(refTokens)); } } require(clPurchasedTokens > 0 || clBonusTokens_ > 0 || clRefTokens > 0 || clReceivedTokens > 0); emit TokensClaimed(msg.sender, clPurchasedTokens, clBonusTokens_, clRefTokens, clReceivedTokens, now, msg.sender); } function refundTokensPurchase(address _investor, uint _purchaseId) external payable onlyOwner { require(msg.value > 0); require(investors[_investor].tokensPurchases[_purchaseId].value == msg.value); _refundTokensPurchase(_investor, _purchaseId); // forward eth to investor's wallet address _investor.transfer(msg.value); } function refundAllInvestorTokensPurchases(address _investor) external payable onlyOwner { require(msg.value > 0); require(investors[_investor].contributionInWei == msg.value); for (uint i = 0; i < investors[_investor].tokensPurchases.length; i++) { if (investors[_investor].tokensPurchases[i].value == 0) { continue; } _refundTokensPurchase(_investor, i); } // forward eth to investor's wallet address _investor.transfer(msg.value); } function _refundTokensPurchase(address _investor, uint _purchaseId) private { // update referrer's referral tokens address referrer = investors[_investor].tokensPurchases[_purchaseId].referrer; if (referrer != address(0)) { uint256 sentAmount = investors[_investor].tokensPurchases[_purchaseId].referrerSentAmount; investors[referrer].referralTokens = investors[referrer].referralTokens.sub(sentAmount); bonusTokens = bonusTokens.sub(sentAmount); } // update investor's eth amount uint256 purchaseValue = investors[_investor].tokensPurchases[_purchaseId].value; investors[_investor].contributionInWei = investors[_investor].contributionInWei.sub(purchaseValue); // update investor's purchased tokens uint256 purchaseAmount = investors[_investor].tokensPurchases[_purchaseId].amount; investors[_investor].purchasedTokens = investors[_investor].purchasedTokens.sub(purchaseAmount); // update investor's bonus tokens uint256 bonusAmount = investors[_investor].tokensPurchases[_purchaseId].bonus; investors[_investor].bonusTokens = investors[_investor].bonusTokens.sub(bonusAmount); // update crowdsale total amount of capital raised weiRaised = weiRaised.sub(purchaseValue); soldTokens = soldTokens.sub(purchaseAmount); bonusTokens = bonusTokens.sub(bonusAmount); // free up storage used by transaction delete (investors[_investor].tokensPurchases[_purchaseId]); // log investor's tokens purchase refund emit TokensPurchaseRefunded(_investor, _purchaseId, purchaseValue, purchaseAmount, bonusAmount, now, msg.sender); } function getInvestorTokensPurchasesLength(address _investor) public constant returns (uint) { return investors[_investor].tokensPurchases.length; } function getInvestorTokensPurchase( address _investor, uint _purchaseId ) external constant returns ( uint256 value, uint256 amount, uint256 bonus, address referrer, uint256 referrerSentAmount ) { value = investors[_investor].tokensPurchases[_purchaseId].value; amount = investors[_investor].tokensPurchases[_purchaseId].amount; bonus = investors[_investor].tokensPurchases[_purchaseId].bonus; referrer = investors[_investor].tokensPurchases[_purchaseId].referrer; referrerSentAmount = investors[_investor].tokensPurchases[_purchaseId].referrerSentAmount; } function pause() external onlyOwner { require(!paused); paused = true; emit Paused(now, msg.sender); } function resume() external onlyOwner { require(paused); paused = false; emit Resumed(now, msg.sender); } function finalize() external onlyOwner { require(!finalized); finalized = true; emit Finalized(now, msg.sender); } } contract DiscountPhases is StaffUtil { using SafeMath for uint256; event DiscountPhaseAdded(uint index, string name, uint8 percent, uint fromDate, uint toDate, uint timestamp, address byStaff); event DiscountPhaseRemoved(uint index, uint timestamp, address byStaff); struct DiscountPhase { uint8 percent; uint fromDate; uint toDate; } DiscountPhase[] public discountPhases; constructor(Staff _staffContract) StaffUtil(_staffContract) public { } function calculateBonusAmount(uint256 _purchasedAmount) public constant returns (uint256) { for (uint i = 0; i < discountPhases.length; i++) { if (now >= discountPhases[i].fromDate && now <= discountPhases[i].toDate) { return _purchasedAmount.mul(discountPhases[i].percent).div(100); } } } function addDiscountPhase(string _name, uint8 _percent, uint _fromDate, uint _toDate) public onlyOwnerOrStaff { require(bytes(_name).length > 0); require(_percent > 0 && _percent <= 100); if (now > _fromDate) { _fromDate = now; } require(_fromDate < _toDate); for (uint i = 0; i < discountPhases.length; i++) { require(_fromDate > discountPhases[i].toDate || _toDate < discountPhases[i].fromDate); } uint index = discountPhases.push(DiscountPhase({percent : _percent, fromDate : _fromDate, toDate : _toDate})) - 1; emit DiscountPhaseAdded(index, _name, _percent, _fromDate, _toDate, now, msg.sender); } function removeDiscountPhase(uint _index) public onlyOwnerOrStaff { require(now < discountPhases[_index].toDate); delete discountPhases[_index]; emit DiscountPhaseRemoved(_index, now, msg.sender); } } contract DiscountStructs is StaffUtil { using SafeMath for uint256; address public crowdsale; event DiscountStructAdded( uint index, bytes32 name, uint256 tokens, uint[2] dates, uint256[] fromWei, uint256[] toWei, uint256[] percent, uint timestamp, address byStaff ); event DiscountStructRemoved( uint index, uint timestamp, address byStaff ); event DiscountStructUsed( uint index, uint step, address investor, uint256 tokens, uint timestamp ); struct DiscountStruct { uint256 availableTokens; uint256 distributedTokens; uint fromDate; uint toDate; } struct DiscountStep { uint256 fromWei; uint256 toWei; uint256 percent; } DiscountStruct[] public discountStructs; mapping(uint => DiscountStep[]) public discountSteps; constructor(Staff _staffContract) StaffUtil(_staffContract) public { } modifier onlyCrowdsale() { require(msg.sender == crowdsale); _; } function setCrowdsale(Crowdsale _crowdsale) external onlyOwner { require(crowdsale == address(0)); require(_crowdsale.staffContract() == staffContract); crowdsale = _crowdsale; } function getBonus(address _investor, uint256 _purchasedAmount, uint256 _purchasedValue) public onlyCrowdsale returns (uint256) { for (uint i = 0; i < discountStructs.length; i++) { if (now >= discountStructs[i].fromDate && now <= discountStructs[i].toDate) { if (discountStructs[i].distributedTokens >= discountStructs[i].availableTokens) { return; } for (uint j = 0; j < discountSteps[i].length; j++) { if (_purchasedValue >= discountSteps[i][j].fromWei && (_purchasedValue < discountSteps[i][j].toWei || discountSteps[i][j].toWei == 0)) { uint256 bonus = _purchasedAmount.mul(discountSteps[i][j].percent).div(100); if (discountStructs[i].distributedTokens.add(bonus) > discountStructs[i].availableTokens) { return; } discountStructs[i].distributedTokens = discountStructs[i].distributedTokens.add(bonus); emit DiscountStructUsed(i, j, _investor, bonus, now); return bonus; } } return; } } } function calculateBonus(uint256 _purchasedAmount, uint256 _purchasedValue) public constant returns (uint256) { for (uint i = 0; i < discountStructs.length; i++) { if (now >= discountStructs[i].fromDate && now <= discountStructs[i].toDate) { if (discountStructs[i].distributedTokens >= discountStructs[i].availableTokens) { return; } for (uint j = 0; j < discountSteps[i].length; j++) { if (_purchasedValue >= discountSteps[i][j].fromWei && (_purchasedValue < discountSteps[i][j].toWei || discountSteps[i][j].toWei == 0)) { uint256 bonus = _purchasedAmount.mul(discountSteps[i][j].percent).div(100); if (discountStructs[i].distributedTokens.add(bonus) > discountStructs[i].availableTokens) { return; } return bonus; } } return; } } } function addDiscountStruct(bytes32 _name, uint256 _tokens, uint[2] _dates, uint256[] _fromWei, uint256[] _toWei, uint256[] _percent) external onlyOwnerOrStaff { require(_name.length > 0); require(_tokens > 0); require(_dates[0] < _dates[1]); require(_fromWei.length > 0 && _fromWei.length == _toWei.length && _fromWei.length == _percent.length); for (uint j = 0; j < discountStructs.length; j++) { require(_dates[0] > discountStructs[j].fromDate || _dates[1] < discountStructs[j].toDate); } DiscountStruct memory ds = DiscountStruct(_tokens, 0, _dates[0], _dates[1]); uint index = discountStructs.push(ds) - 1; for (uint i = 0; i < _fromWei.length; i++) { require(_fromWei[i] > 0 || _toWei[i] > 0); if (_fromWei[i] > 0 && _toWei[i] > 0) { require(_fromWei[i] < _toWei[i]); } require(_percent[i] > 0 && _percent[i] <= 100); discountSteps[index].push(DiscountStep(_fromWei[i], _toWei[i], _percent[i])); } emit DiscountStructAdded(index, _name, _tokens, _dates, _fromWei, _toWei, _percent, now, msg.sender); } function removeDiscountStruct(uint _index) public onlyOwnerOrStaff { require(now < discountStructs[_index].toDate); delete discountStructs[_index]; delete discountSteps[_index]; emit DiscountStructRemoved(_index, now, msg.sender); } } contract PromoCodes is StaffUtil { using SafeMath for uint256; address public crowdsale; event PromoCodeAdded(bytes32 indexed code, string name, uint8 percent, uint256 maxUses, uint timestamp, address byStaff); event PromoCodeRemoved(bytes32 indexed code, uint timestamp, address byStaff); event PromoCodeUsed(bytes32 indexed code, address investor, uint timestamp); struct PromoCode { uint8 percent; uint256 uses; uint256 maxUses; mapping(address => bool) investors; } mapping(bytes32 => PromoCode) public promoCodes; constructor(Staff _staffContract) StaffUtil(_staffContract) public { } modifier onlyCrowdsale() { require(msg.sender == crowdsale); _; } function setCrowdsale(Crowdsale _crowdsale) external onlyOwner { require(crowdsale == address(0)); require(_crowdsale.staffContract() == staffContract); crowdsale = _crowdsale; } function applyBonusAmount(address _investor, uint256 _purchasedAmount, bytes32 _promoCode) public onlyCrowdsale returns (uint256) { if (promoCodes[_promoCode].percent == 0 || promoCodes[_promoCode].investors[_investor] || promoCodes[_promoCode].uses == promoCodes[_promoCode].maxUses) { return 0; } promoCodes[_promoCode].investors[_investor] = true; promoCodes[_promoCode].uses = promoCodes[_promoCode].uses + 1; emit PromoCodeUsed(_promoCode, _investor, now); return _purchasedAmount.mul(promoCodes[_promoCode].percent).div(100); } function calculateBonusAmount(address _investor, uint256 _purchasedAmount, bytes32 _promoCode) public constant returns (uint256) { if (promoCodes[_promoCode].percent == 0 || promoCodes[_promoCode].investors[_investor] || promoCodes[_promoCode].uses == promoCodes[_promoCode].maxUses) { return 0; } return _purchasedAmount.mul(promoCodes[_promoCode].percent).div(100); } function addPromoCode(string _name, bytes32 _code, uint256 _maxUses, uint8 _percent) public onlyOwnerOrStaff { require(bytes(_name).length > 0); require(_code[0] != 0); require(_percent > 0 && _percent <= 100); require(_maxUses > 0); require(promoCodes[_code].percent == 0); promoCodes[_code].percent = _percent; promoCodes[_code].maxUses = _maxUses; emit PromoCodeAdded(_code, _name, _percent, _maxUses, now, msg.sender); } function removePromoCode(bytes32 _code) public onlyOwnerOrStaff { delete promoCodes[_code]; emit PromoCodeRemoved(_code, now, msg.sender); } } contract Token is BurnableToken { }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"discountStructs","outputs":[{"name":"availableTokens","type":"uint256"},{"name":"distributedTokens","type":"uint256"},{"name":"fromDate","type":"uint256"},{"name":"toDate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"discountSteps","outputs":[{"name":"fromWei","type":"uint256"},{"name":"toWei","type":"uint256"},{"name":"percent","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_crowdsale","type":"address"}],"name":"setCrowdsale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_tokens","type":"uint256"},{"name":"_dates","type":"uint256[2]"},{"name":"_fromWei","type":"uint256[]"},{"name":"_toWei","type":"uint256[]"},{"name":"_percent","type":"uint256[]"}],"name":"addDiscountStruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_purchasedAmount","type":"uint256"},{"name":"_purchasedValue","type":"uint256"}],"name":"calculateBonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_investor","type":"address"},{"name":"_purchasedAmount","type":"uint256"},{"name":"_purchasedValue","type":"uint256"}],"name":"getBonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"crowdsale","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"}],"name":"removeDiscountStruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"staffContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_staffContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"index","type":"uint256"},{"indexed":false,"name":"name","type":"bytes32"},{"indexed":false,"name":"tokens","type":"uint256"},{"indexed":false,"name":"dates","type":"uint256[2]"},{"indexed":false,"name":"fromWei","type":"uint256[]"},{"indexed":false,"name":"toWei","type":"uint256[]"},{"indexed":false,"name":"percent","type":"uint256[]"},{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":false,"name":"byStaff","type":"address"}],"name":"DiscountStructAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"index","type":"uint256"},{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":false,"name":"byStaff","type":"address"}],"name":"DiscountStructRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"index","type":"uint256"},{"indexed":false,"name":"step","type":"uint256"},{"indexed":false,"name":"investor","type":"address"},{"indexed":false,"name":"tokens","type":"uint256"},{"indexed":false,"name":"timestamp","type":"uint256"}],"name":"DiscountStructUsed","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405160208061196683398101806040528101908080519060200190929190505050808073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561009857600080fd5b505af11580156100ac573d6000803e3d6000fd5b505050506040513d60208110156100c257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561010c57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506118098061015d6000396000f300608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806331a3d8481461009e5780633f5c1534146100f4578063483a20b21461014d5780636660da77146101905780636f72fd201461021d57806379544754146102685780639c1e03a0146102d3578063f970bbfc1461032a578063fc28bc8f14610357575b600080fd5b3480156100aa57600080fd5b506100c9600480360381019080803590602001909291905050506103ae565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561010057600080fd5b5061012960048036038101908080359060200190929190803590602001909291905050506103ed565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561015957600080fd5b5061018e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610433565b005b34801561019c57600080fd5b5061021b600480360381019080803560001916906020019092919080359060200190929190806040019091929192908035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293905050506106c6565b005b34801561022957600080fd5b506102526004803603810190808035906020019092919080359060200190929190505050610d81565b6040518082815260200191505060405180910390f35b34801561027457600080fd5b506102bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610ffa565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b506102e86113aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033657600080fd5b50610355600480360381019080803590602001909291905050506113d0565b005b34801561036357600080fd5b5061036c6116ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6002818154811015156103bd57fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030154905084565b60036020528160005260406000208181548110151561040857fe5b9060005260206000209060030201600091509150508060000154908060010154908060020154905083565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156104b857600080fd5b505af11580156104cc573d6000803e3d6000fd5b505050506040513d60208110156104e257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561052c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561058957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663fc28bc8f6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561062557600080fd5b505af1158015610639573d6000803e3d6000fd5b505050506040513d602081101561064f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614151561068257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006106d0611759565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561075857600080fd5b505af115801561076c573d6000803e3d6000fd5b505050506040513d602081101561078257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108bf57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb510e97336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561088357600080fd5b505af1158015610897573d6000803e3d6000fd5b505050506040513d60208110156108ad57600080fd5b81019080805190602001909291905050505b15156108ca57600080fd5b6000602060ff161115156108dd57600080fd5b60008c1115156108ec57600080fd5b8a60016002811015156108fb57fe5b60200201358b600060028110151561090f57fe5b602002013510151561092057600080fd5b60008a8a90501180156109385750878790508a8a9050145b80156109495750858590508a8a9050145b151561095457600080fd5b600093505b6002805490508410156109f15760028481548110151561097557fe5b9060005260206000209060040201600201548b600060028110151561099657fe5b602002013511806109d957506002848154811015156109b157fe5b9060005260206000209060040201600301548b60016002811015156109d257fe5b6020020135105b15156109e457600080fd5b8380600101945050610959565b6080604051908101604052808d8152602001600081526020018c6000600281101515610a1957fe5b602002013581526020018c6001600281101515610a3257fe5b60200201358152509250600160028490806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050039150600090505b89899050811015610c675760008a8a838181101515610ab957fe5b905060200201351180610ae0575060008888838181101515610ad757fe5b90506020020135115b1515610aeb57600080fd5b60008a8a838181101515610afb57fe5b90506020020135118015610b23575060008888838181101515610b1a57fe5b90506020020135115b15610b5f578787828181101515610b3657fe5b905060200201358a8a838181101515610b4b57fe5b90506020020135101515610b5e57600080fd5b5b60008686838181101515610b6f57fe5b90506020020135118015610b98575060648686838181101515610b8e57fe5b9050602002013511155b1515610ba357600080fd5b600360008381526020019081526020016000206060604051908101604052808c8c858181101515610bd057fe5b9050602002013581526020018a8a858181101515610bea57fe5b9050602002013581526020018888858181101515610c0457fe5b90506020020135815250908060018154018082558091505090600182039060005260206000209060030201600090919290919091506000820151816000015560208201518160010155604082015181600201555050508080600101915050610a9e565b7f84533bc2797711013dd738294b19ed9d0a482e9ceba61c17cd2aa09d0a4d2f45828e8e8e8e8e8e8e8e8e4233604051808d81526020018c600019166000191681526020018b81526020018a60026020028082843782019150508060200180602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184810384528c8c82818152602001925060200280828437820191505084810383528a8a828181526020019250602002808284378201915050848103825288888281815260200192506020028082843782019150509f5050505050505050505050505050505060405180910390a150505050505050505050505050565b600080600080600092505b600280549050831015610ff057600283815481101515610da857fe5b9060005260206000209060040201600201544210158015610de95750600283815481101515610dd357fe5b9060005260206000209060040201600301544211155b15610fe357600283815481101515610dfd57fe5b906000526020600020906004020160000154600284815481101515610e1e57fe5b906000526020600020906004020160010154101515610e3c57610ff1565b600091505b6003600084815260200190815260200160002080549050821015610fde576003600084815260200190815260200160002082815481101515610e7f57fe5b9060005260206000209060030201600001548510158015610f0c57506003600084815260200190815260200160002082815481101515610ebb57fe5b906000526020600020906003020160010154851080610f0b575060006003600085815260200190815260200160002083815481101515610ef757fe5b906000526020600020906003020160010154145b5b15610fd157610f686064610f5a6003600087815260200190815260200160002085815481101515610f3957fe5b906000526020600020906003020160020154896116ef90919063ffffffff16565b61172790919063ffffffff16565b9050600283815481101515610f7957fe5b906000526020600020906004020160000154610fbe82600286815481101515610f9e57fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b1115610fc957610ff1565b809350610ff1565b8180600101925050610e41565b610ff1565b8280600101935050610d8c565b5b50505092915050565b600080600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105c57600080fd5b600092505b60028054905083101561139f5760028381548110151561107d57fe5b90600052602060002090600402016002015442101580156110be57506002838154811015156110a857fe5b9060005260206000209060040201600301544211155b15611392576002838154811015156110d257fe5b9060005260206000209060040201600001546002848154811015156110f357fe5b906000526020600020906004020160010154101515611111576113a0565b600091505b600360008481526020019081526020016000208054905082101561138d57600360008481526020019081526020016000208281548110151561115457fe5b90600052602060002090600302016000015485101580156111e15750600360008481526020019081526020016000208281548110151561119057fe5b9060005260206000209060030201600101548510806111e05750600060036000858152602001908152602001600020838154811015156111cc57fe5b906000526020600020906003020160010154145b5b156113805761123d606461122f600360008781526020019081526020016000208581548110151561120e57fe5b906000526020600020906003020160020154896116ef90919063ffffffff16565b61172790919063ffffffff16565b905060028381548110151561124e57fe5b9060005260206000209060040201600001546112938260028681548110151561127357fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b111561129e576113a0565b6112d1816002858154811015156112b157fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b6002848154811015156112e057fe5b9060005260206000209060040201600101819055507fa630d47fbd7ee93971935eb378c18d3ca9fc980520d57362448e6e87011c7e0d8383898442604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019550505050505060405180910390a18093506113a0565b8180600101925050611116565b6113a0565b8280600101935050611061565b5b5050509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b505050506040513d602081101561147f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115bc57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb510e97336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561158057600080fd5b505af1158015611594573d6000803e3d6000fd5b505050506040513d60208110156115aa57600080fd5b81019080805190602001909291905050505b15156115c757600080fd5b6002818154811015156115d657fe5b906000526020600020906004020160030154421015156115f557600080fd5b60028181548110151561160457fe5b906000526020600020906004020160008082016000905560018201600090556002820160009055600382016000905550506003600082815260200190815260200160002060006116549190611782565b7f7270a7e17010df41a7a02e169fbbf3b7d9fbed22b11708d55d8fb9295595f895814233604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808314156117025760009050611721565b818302905081838281151561171357fe5b0414151561171d57fe5b8090505b92915050565b6000818381151561173457fe5b04905092915050565b6000818301905082811015151561175057fe5b80905092915050565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b50805460008255600302906000526020600020908101906117a391906117a6565b50565b6117da91905b808211156117d65760008082016000905560018201600090556002820160009055506003016117ac565b5090565b905600a165627a7a72305820c2056093f3ce747027a2d982c4cb969fe64157197a84f4098c405c014db2977400290000000000000000000000003525ac6cc8c673d74bcd94a4c005c9301fad135b
Deployed Bytecode
0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806331a3d8481461009e5780633f5c1534146100f4578063483a20b21461014d5780636660da77146101905780636f72fd201461021d57806379544754146102685780639c1e03a0146102d3578063f970bbfc1461032a578063fc28bc8f14610357575b600080fd5b3480156100aa57600080fd5b506100c9600480360381019080803590602001909291905050506103ae565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561010057600080fd5b5061012960048036038101908080359060200190929190803590602001909291905050506103ed565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561015957600080fd5b5061018e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610433565b005b34801561019c57600080fd5b5061021b600480360381019080803560001916906020019092919080359060200190929190806040019091929192908035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293905050506106c6565b005b34801561022957600080fd5b506102526004803603810190808035906020019092919080359060200190929190505050610d81565b6040518082815260200191505060405180910390f35b34801561027457600080fd5b506102bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610ffa565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b506102e86113aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033657600080fd5b50610355600480360381019080803590602001909291905050506113d0565b005b34801561036357600080fd5b5061036c6116ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6002818154811015156103bd57fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030154905084565b60036020528160005260406000208181548110151561040857fe5b9060005260206000209060030201600091509150508060000154908060010154908060020154905083565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156104b857600080fd5b505af11580156104cc573d6000803e3d6000fd5b505050506040513d60208110156104e257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561052c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561058957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663fc28bc8f6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561062557600080fd5b505af1158015610639573d6000803e3d6000fd5b505050506040513d602081101561064f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614151561068257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006106d0611759565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561075857600080fd5b505af115801561076c573d6000803e3d6000fd5b505050506040513d602081101561078257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108bf57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb510e97336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561088357600080fd5b505af1158015610897573d6000803e3d6000fd5b505050506040513d60208110156108ad57600080fd5b81019080805190602001909291905050505b15156108ca57600080fd5b6000602060ff161115156108dd57600080fd5b60008c1115156108ec57600080fd5b8a60016002811015156108fb57fe5b60200201358b600060028110151561090f57fe5b602002013510151561092057600080fd5b60008a8a90501180156109385750878790508a8a9050145b80156109495750858590508a8a9050145b151561095457600080fd5b600093505b6002805490508410156109f15760028481548110151561097557fe5b9060005260206000209060040201600201548b600060028110151561099657fe5b602002013511806109d957506002848154811015156109b157fe5b9060005260206000209060040201600301548b60016002811015156109d257fe5b6020020135105b15156109e457600080fd5b8380600101945050610959565b6080604051908101604052808d8152602001600081526020018c6000600281101515610a1957fe5b602002013581526020018c6001600281101515610a3257fe5b60200201358152509250600160028490806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050039150600090505b89899050811015610c675760008a8a838181101515610ab957fe5b905060200201351180610ae0575060008888838181101515610ad757fe5b90506020020135115b1515610aeb57600080fd5b60008a8a838181101515610afb57fe5b90506020020135118015610b23575060008888838181101515610b1a57fe5b90506020020135115b15610b5f578787828181101515610b3657fe5b905060200201358a8a838181101515610b4b57fe5b90506020020135101515610b5e57600080fd5b5b60008686838181101515610b6f57fe5b90506020020135118015610b98575060648686838181101515610b8e57fe5b9050602002013511155b1515610ba357600080fd5b600360008381526020019081526020016000206060604051908101604052808c8c858181101515610bd057fe5b9050602002013581526020018a8a858181101515610bea57fe5b9050602002013581526020018888858181101515610c0457fe5b90506020020135815250908060018154018082558091505090600182039060005260206000209060030201600090919290919091506000820151816000015560208201518160010155604082015181600201555050508080600101915050610a9e565b7f84533bc2797711013dd738294b19ed9d0a482e9ceba61c17cd2aa09d0a4d2f45828e8e8e8e8e8e8e8e8e4233604051808d81526020018c600019166000191681526020018b81526020018a60026020028082843782019150508060200180602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184810384528c8c82818152602001925060200280828437820191505084810383528a8a828181526020019250602002808284378201915050848103825288888281815260200192506020028082843782019150509f5050505050505050505050505050505060405180910390a150505050505050505050505050565b600080600080600092505b600280549050831015610ff057600283815481101515610da857fe5b9060005260206000209060040201600201544210158015610de95750600283815481101515610dd357fe5b9060005260206000209060040201600301544211155b15610fe357600283815481101515610dfd57fe5b906000526020600020906004020160000154600284815481101515610e1e57fe5b906000526020600020906004020160010154101515610e3c57610ff1565b600091505b6003600084815260200190815260200160002080549050821015610fde576003600084815260200190815260200160002082815481101515610e7f57fe5b9060005260206000209060030201600001548510158015610f0c57506003600084815260200190815260200160002082815481101515610ebb57fe5b906000526020600020906003020160010154851080610f0b575060006003600085815260200190815260200160002083815481101515610ef757fe5b906000526020600020906003020160010154145b5b15610fd157610f686064610f5a6003600087815260200190815260200160002085815481101515610f3957fe5b906000526020600020906003020160020154896116ef90919063ffffffff16565b61172790919063ffffffff16565b9050600283815481101515610f7957fe5b906000526020600020906004020160000154610fbe82600286815481101515610f9e57fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b1115610fc957610ff1565b809350610ff1565b8180600101925050610e41565b610ff1565b8280600101935050610d8c565b5b50505092915050565b600080600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105c57600080fd5b600092505b60028054905083101561139f5760028381548110151561107d57fe5b90600052602060002090600402016002015442101580156110be57506002838154811015156110a857fe5b9060005260206000209060040201600301544211155b15611392576002838154811015156110d257fe5b9060005260206000209060040201600001546002848154811015156110f357fe5b906000526020600020906004020160010154101515611111576113a0565b600091505b600360008481526020019081526020016000208054905082101561138d57600360008481526020019081526020016000208281548110151561115457fe5b90600052602060002090600302016000015485101580156111e15750600360008481526020019081526020016000208281548110151561119057fe5b9060005260206000209060030201600101548510806111e05750600060036000858152602001908152602001600020838154811015156111cc57fe5b906000526020600020906003020160010154145b5b156113805761123d606461122f600360008781526020019081526020016000208581548110151561120e57fe5b906000526020600020906003020160020154896116ef90919063ffffffff16565b61172790919063ffffffff16565b905060028381548110151561124e57fe5b9060005260206000209060040201600001546112938260028681548110151561127357fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b111561129e576113a0565b6112d1816002858154811015156112b157fe5b90600052602060002090600402016001015461173d90919063ffffffff16565b6002848154811015156112e057fe5b9060005260206000209060040201600101819055507fa630d47fbd7ee93971935eb378c18d3ca9fc980520d57362448e6e87011c7e0d8383898442604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019550505050505060405180910390a18093506113a0565b8180600101925050611116565b6113a0565b8280600101935050611061565b5b5050509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b505050506040513d602081101561147f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115bc57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb510e97336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561158057600080fd5b505af1158015611594573d6000803e3d6000fd5b505050506040513d60208110156115aa57600080fd5b81019080805190602001909291905050505b15156115c757600080fd5b6002818154811015156115d657fe5b906000526020600020906004020160030154421015156115f557600080fd5b60028181548110151561160457fe5b906000526020600020906004020160008082016000905560018201600090556002820160009055600382016000905550506003600082815260200190815260200160002060006116549190611782565b7f7270a7e17010df41a7a02e169fbbf3b7d9fbed22b11708d55d8fb9295595f895814233604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808314156117025760009050611721565b818302905081838281151561171357fe5b0414151561171d57fe5b8090505b92915050565b6000818381151561173457fe5b04905092915050565b6000818301905082811015151561175057fe5b80905092915050565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b50805460008255600302906000526020600020908101906117a391906117a6565b50565b6117da91905b808211156117d65760008082016000905560018201600090556002820160009055506003016117ac565b5090565b905600a165627a7a72305820c2056093f3ce747027a2d982c4cb969fe64157197a84f4098c405c014db297740029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003525ac6cc8c673d74bcd94a4c005c9301fad135b
-----Decoded View---------------
Arg [0] : _staffContract (address): 0x3525Ac6cC8c673d74bCd94a4C005c9301Fad135B
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003525ac6cc8c673d74bcd94a4c005c9301fad135b
Swarm Source
bzzr://c2056093f3ce747027a2d982c4cb969fe64157197a84f4098c405c014db29774
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.