Transaction Hash:
Block:
4860090 at Jan-05-2018 09:14:43 PM +UTC
Transaction Fee:
0.00126282 ETH
$2.39
Gas Used:
63,141 Gas / 20 Gwei
Emitted Events:
51 |
ENJToken.Transfer( _from=[Receiver] EtherDelta, _to=[Sender] 0x7a479e895aacb1282e3ae4114ff174aeedcaea72, _value=16336250000000000000000 )
|
52 |
EtherDelta.Withdraw( token=ENJToken, user=[Sender] 0x7a479e895aacb1282e3ae4114ff174aeedcaea72, amount=16336250000000000000000, balance=429996469819770 )
|
Account State Difference:
Address | Before | After | State Difference | ||
---|---|---|---|---|---|
0x7a479e89...eEdcaeA72 |
0.079654028 Eth
Nonce: 23
|
0.078391208 Eth
Nonce: 24
| 0.00126282 | ||
0x8d12A197...2A5CC6819 | (EtherDelta 2) | ||||
0xEA674fdD...16B898ec8
Miner
| (Ethermine) | 733.929446981894421691 Eth | 733.930709801894421691 Eth | 0.00126282 | |
0xF629cBd9...80E2a3B9c |
Execution Trace
EtherDelta.withdrawToken( token=0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c, amount=16336250000000000000000 )
-
ENJToken.transfer( _to=0x7a479e895AAcB1282e3AE4114ff174AeEdcaeA72, _value=16336250000000000000000 ) => ( success=True )
withdrawToken[EtherDelta (ln:234)]
safeSub[EtherDelta (ln:237)]
transfer[EtherDelta (ln:238)]
Withdraw[EtherDelta (ln:239)]
File 1 of 2: EtherDelta
File 2 of 2: ENJToken
pragma solidity ^0.4.9; contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function assert(bool assertion) internal { if (!assertion) throw; } } contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success) {} /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success) {} /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); uint public decimals; string public name; } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { //Default assumes totalSupply can't be over max (2^256 - 1). //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap. //Replace the if with this one instead. if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { //if (balances[msg.sender] >= _value && _value > 0) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { //same as above. Replace this line with the following if you want to protect against wrapping uints. if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { //if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract ReserveToken is StandardToken, SafeMath { address public minter; function ReserveToken() { minter = msg.sender; } function create(address account, uint amount) { if (msg.sender != minter) throw; balances[account] = safeAdd(balances[account], amount); totalSupply = safeAdd(totalSupply, amount); } function destroy(address account, uint amount) { if (msg.sender != minter) throw; if (balances[account] < amount) throw; balances[account] = safeSub(balances[account], amount); totalSupply = safeSub(totalSupply, amount); } } contract AccountLevels { //given a user, returns an account level //0 = regular user (pays take fee and make fee) //1 = market maker silver (pays take fee, no make fee, gets rebate) //2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate) function accountLevel(address user) constant returns(uint) {} } contract AccountLevelsTest is AccountLevels { mapping (address => uint) public accountLevels; function setAccountLevel(address user, uint level) { accountLevels[user] = level; } function accountLevel(address user) constant returns(uint) { return accountLevels[user]; } } contract EtherDelta is SafeMath { address public admin; //the admin address address public feeAccount; //the account that will receive fees address public accountLevelsAddr; //the address of the AccountLevels contract uint public feeMake; //percentage times (1 ether) uint public feeTake; //percentage times (1 ether) uint public feeRebate; //percentage times (1 ether) mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether) mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature) mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled) event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user); event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s); event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give); event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); function EtherDelta(address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) { admin = admin_; feeAccount = feeAccount_; accountLevelsAddr = accountLevelsAddr_; feeMake = feeMake_; feeTake = feeTake_; feeRebate = feeRebate_; } function() { throw; } function changeAdmin(address admin_) { if (msg.sender != admin) throw; admin = admin_; } function changeAccountLevelsAddr(address accountLevelsAddr_) { if (msg.sender != admin) throw; accountLevelsAddr = accountLevelsAddr_; } function changeFeeAccount(address feeAccount_) { if (msg.sender != admin) throw; feeAccount = feeAccount_; } function changeFeeMake(uint feeMake_) { if (msg.sender != admin) throw; if (feeMake_ > feeMake) throw; feeMake = feeMake_; } function changeFeeTake(uint feeTake_) { if (msg.sender != admin) throw; if (feeTake_ > feeTake || feeTake_ < feeRebate) throw; feeTake = feeTake_; } function changeFeeRebate(uint feeRebate_) { if (msg.sender != admin) throw; if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw; feeRebate = feeRebate_; } function deposit() payable { tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value); Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]); } function withdraw(uint amount) { if (tokens[0][msg.sender] < amount) throw; tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount); if (!msg.sender.call.value(amount)()) throw; Withdraw(0, msg.sender, amount, tokens[0][msg.sender]); } function depositToken(address token, uint amount) { //remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf. if (token==0) throw; if (!Token(token).transferFrom(msg.sender, this, amount)) throw; tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount); Deposit(token, msg.sender, amount, tokens[token][msg.sender]); } function withdrawToken(address token, uint amount) { if (token==0) throw; if (tokens[token][msg.sender] < amount) throw; tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount); if (!Token(token).transfer(msg.sender, amount)) throw; Withdraw(token, msg.sender, amount, tokens[token][msg.sender]); } function balanceOf(address token, address user) constant returns (uint) { return tokens[token][user]; } function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); orders[msg.sender][hash] = true; Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender); } function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) { //amount is in amountGet terms bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires && safeAdd(orderFills[user][hash], amount) <= amountGet )) throw; tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount); orderFills[user][hash] = safeAdd(orderFills[user][hash], amount); Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender); } function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private { uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether); uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether); uint feeRebateXfer = 0; if (accountLevelsAddr != 0x0) { uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user); if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether); if (accountLevel==2) feeRebateXfer = feeTakeXfer; } tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer)); tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer)); tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer)); tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet); tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet); } function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) { if (!( tokens[tokenGet][sender] >= amount && availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount )) return false; return true; } function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires )) return 0; uint available1 = safeSub(amountGet, orderFills[user][hash]); uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive; if (available1<available2) return available1; return available2; } function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); return orderFills[user][hash]; } function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw; orderFills[msg.sender][hash] = amountGet; Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s); } }
File 2 of 2: ENJToken
pragma solidity ^0.4.15; /* Utilities & Common Modifiers */ contract Utils { /** constructor */ function Utils() { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different than this contract address modifier notThis(address _address) { require(_address != address(this)); _; } // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; } /** @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */ function safeSub(uint256 _x, uint256 _y) internal returns (uint256) { assert(_x >= _y); return _x - _y; } /** @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */ function safeMul(uint256 _x, uint256 _y) internal returns (uint256) { uint256 z = _x * _y; assert(_x == 0 || z / _x == _y); return z; } } /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) { name; } function symbol() public constant returns (string) { symbol; } function decimals() public constant returns (uint8) { decimals; } function totalSupply() public constant returns (uint256) { totalSupply; } function balanceOf(address _owner) public constant returns (uint256 balance) { _owner; balance; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { _owner; _spender; remaining; } function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } /** ERC20 Standard Token implementation */ contract ERC20Token is IERC20Token, Utils { string public standard = "Token 0.1"; string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); /** @dev constructor @param _name token name @param _symbol token symbol @param _decimals decimal points, for display purposes */ function ERC20Token(string _name, string _symbol, uint8 _decimals) { require(bytes(_name).length > 0 && bytes(_symbol).length > 0); // validate input name = _name; symbol = _symbol; decimals = _decimals; } /** @dev send coins throws on any error rather then return a false flag to minimize user errors @param _to target address @param _value transfer amount @return true if the transfer was successful, false if it wasn't */ function transfer(address _to, uint256 _value) public validAddress(_to) returns (bool success) { balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); Transfer(msg.sender, _to, _value); return true; } /** @dev an account/contract attempts to get the coins throws on any error rather then return a false flag to minimize user errors @param _from source address @param _to target address @param _value transfer amount @return true if the transfer was successful, false if it wasn't */ function transferFrom(address _from, address _to, uint256 _value) public validAddress(_from) validAddress(_to) returns (bool success) { allowance[_from][msg.sender] = safeSub(allowance[_from][msg.sender], _value); balanceOf[_from] = safeSub(balanceOf[_from], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); Transfer(_from, _to, _value); return true; } /** @dev allow another account/contract to spend some tokens on your behalf throws on any error rather then return a false flag to minimize user errors also, to minimize the risk of the approve/transferFrom attack vector (see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/), approve has to be called twice in 2 separate transactions - once to change the allowance to 0 and secondly to change it to the new allowance value @param _spender approved address @param _value allowance amount @return true if the approval was successful, false if it wasn't */ function approve(address _spender, uint256 _value) public validAddress(_spender) returns (bool success) { // if the allowance isn't 0, it can only be updated to 0 to prevent an allowance change immediately after withdrawal require(_value == 0 || allowance[msg.sender][_spender] == 0); allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } } /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address) { owner; } function transferOwnership(address _newOwner) public; function acceptOwnership() public; } /* Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() { owner = msg.sender; } // allows execution by the owner only modifier ownerOnly { assert(msg.sender == owner); _; } /** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = 0x0; } } /* Token Holder interface */ contract ITokenHolder is IOwned { function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public; } /* We consider every contract to be a 'token holder' since it's currently not possible for a contract to deny receiving tokens. The TokenHolder's contract sole purpose is to provide a safety mechanism that allows the owner to send tokens that were sent to the contract by mistake back to their sender. */ contract TokenHolder is ITokenHolder, Owned, Utils { /** @dev constructor */ function TokenHolder() { } /** @dev withdraws tokens held by the contract and sends them to an account can only be called by the owner @param _token ERC20 token contract address @param _to account to receive the new amount @param _amount amount to withdraw */ function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { assert(_token.transfer(_to, _amount)); } } contract ENJToken is ERC20Token, TokenHolder { ///////////////////////////////////////// VARIABLE INITIALIZATION ///////////////////////////////////////// uint256 constant public ENJ_UNIT = 10 ** 18; uint256 public totalSupply = 1 * (10**9) * ENJ_UNIT; // Constants uint256 constant public maxPresaleSupply = 600 * 10**6 * ENJ_UNIT; // Total presale supply at max bonus uint256 constant public minCrowdsaleAllocation = 200 * 10**6 * ENJ_UNIT; // Min amount for crowdsale uint256 constant public incentivisationAllocation = 100 * 10**6 * ENJ_UNIT; // Incentivisation Allocation uint256 constant public advisorsAllocation = 26 * 10**6 * ENJ_UNIT; // Advisors Allocation uint256 constant public enjinTeamAllocation = 74 * 10**6 * ENJ_UNIT; // Enjin Team allocation address public crowdFundAddress; // Address of the crowdfund address public advisorAddress; // Enjin advisor's address address public incentivisationFundAddress; // Address that holds the incentivization funds address public enjinTeamAddress; // Enjin Team address // Variables uint256 public totalAllocatedToAdvisors = 0; // Counter to keep track of advisor token allocation uint256 public totalAllocatedToTeam = 0; // Counter to keep track of team token allocation uint256 public totalAllocated = 0; // Counter to keep track of overall token allocation uint256 constant public endTime = 1509494340; // 10/31/2017 @ 11:59pm (UTC) crowdsale end time (in seconds) bool internal isReleasedToPublic = false; // Flag to allow transfer/transferFrom before the end of the crowdfund uint256 internal teamTranchesReleased = 0; // Track how many tranches (allocations of 12.5% team tokens) have been released uint256 internal maxTeamTranches = 8; // The number of tranches allowed to the team until depleted ///////////////////////////////////////// MODIFIERS ///////////////////////////////////////// // Enjin Team timelock modifier safeTimelock() { require(now >= endTime + 6 * 4 weeks); _; } // Advisor Team timelock modifier advisorTimelock() { require(now >= endTime + 2 * 4 weeks); _; } // Function only accessible by the Crowdfund contract modifier crowdfundOnly() { require(msg.sender == crowdFundAddress); _; } ///////////////////////////////////////// CONSTRUCTOR ///////////////////////////////////////// /** @dev constructor @param _crowdFundAddress Crowdfund address @param _advisorAddress Advisor address */ function ENJToken(address _crowdFundAddress, address _advisorAddress, address _incentivisationFundAddress, address _enjinTeamAddress) ERC20Token("Enjin Coin", "ENJ", 18) { crowdFundAddress = _crowdFundAddress; advisorAddress = _advisorAddress; enjinTeamAddress = _enjinTeamAddress; incentivisationFundAddress = _incentivisationFundAddress; balanceOf[_crowdFundAddress] = minCrowdsaleAllocation + maxPresaleSupply; // Total presale + crowdfund tokens balanceOf[_incentivisationFundAddress] = incentivisationAllocation; // 10% Allocated for Marketing and Incentivisation totalAllocated += incentivisationAllocation; // Add to total Allocated funds } ///////////////////////////////////////// ERC20 OVERRIDE ///////////////////////////////////////// /** @dev send coins throws on any error rather then return a false flag to minimize user errors in addition to the standard checks, the function throws if transfers are disabled @param _to target address @param _value transfer amount @return true if the transfer was successful, throws if it wasn't */ function transfer(address _to, uint256 _value) public returns (bool success) { if (isTransferAllowed() == true || msg.sender == crowdFundAddress || msg.sender == incentivisationFundAddress) { assert(super.transfer(_to, _value)); return true; } revert(); } /** @dev an account/contract attempts to get the coins throws on any error rather then return a false flag to minimize user errors in addition to the standard checks, the function throws if transfers are disabled @param _from source address @param _to target address @param _value transfer amount @return true if the transfer was successful, throws if it wasn't */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { if (isTransferAllowed() == true || msg.sender == crowdFundAddress || msg.sender == incentivisationFundAddress) { assert(super.transferFrom(_from, _to, _value)); return true; } revert(); } ///////////////////////////////////////// ALLOCATION FUNCTIONS ///////////////////////////////////////// /** @dev Release one single tranche of the Enjin Team Token allocation throws if before timelock (6 months) ends and if not initiated by the owner of the contract returns true if valid Schedule goes as follows: 3 months: 12.5% (this tranche can only be released after the initial 6 months has passed) 6 months: 12.5% 9 months: 12.5% 12 months: 12.5% 15 months: 12.5% 18 months: 12.5% 21 months: 12.5% 24 months: 12.5% @return true if successful, throws if not */ function releaseEnjinTeamTokens() safeTimelock ownerOnly returns(bool success) { require(totalAllocatedToTeam < enjinTeamAllocation); uint256 enjinTeamAlloc = enjinTeamAllocation / 1000; uint256 currentTranche = uint256(now - endTime) / 12 weeks; // "months" after crowdsale end time (division floored) if(teamTranchesReleased < maxTeamTranches && currentTranche > teamTranchesReleased) { teamTranchesReleased++; uint256 amount = safeMul(enjinTeamAlloc, 125); balanceOf[enjinTeamAddress] = safeAdd(balanceOf[enjinTeamAddress], amount); Transfer(0x0, enjinTeamAddress, amount); totalAllocated = safeAdd(totalAllocated, amount); totalAllocatedToTeam = safeAdd(totalAllocatedToTeam, amount); return true; } revert(); } /** @dev release Advisors Token allocation throws if before timelock (2 months) ends or if no initiated by the advisors address or if there is no more allocation to give out returns true if valid @return true if successful, throws if not */ function releaseAdvisorTokens() advisorTimelock ownerOnly returns(bool success) { require(totalAllocatedToAdvisors == 0); balanceOf[advisorAddress] = safeAdd(balanceOf[advisorAddress], advisorsAllocation); totalAllocated = safeAdd(totalAllocated, advisorsAllocation); totalAllocatedToAdvisors = advisorsAllocation; Transfer(0x0, advisorAddress, advisorsAllocation); return true; } /** @dev Retrieve unsold tokens from the crowdfund throws if before timelock (6 months from end of Crowdfund) ends and if no initiated by the owner of the contract returns true if valid @return true if successful, throws if not */ function retrieveUnsoldTokens() safeTimelock ownerOnly returns(bool success) { uint256 amountOfTokens = balanceOf[crowdFundAddress]; balanceOf[crowdFundAddress] = 0; balanceOf[incentivisationFundAddress] = safeAdd(balanceOf[incentivisationFundAddress], amountOfTokens); totalAllocated = safeAdd(totalAllocated, amountOfTokens); Transfer(crowdFundAddress, incentivisationFundAddress, amountOfTokens); return true; } /** @dev Keep track of token allocations can only be called by the crowdfund contract */ function addToAllocation(uint256 _amount) crowdfundOnly { totalAllocated = safeAdd(totalAllocated, _amount); } /** @dev Function to allow transfers can only be called by the owner of the contract Transfers will be allowed regardless after the crowdfund end time. */ function allowTransfers() ownerOnly { isReleasedToPublic = true; } /** @dev User transfers are allowed/rejected Transfers are forbidden before the end of the crowdfund */ function isTransferAllowed() internal constant returns(bool) { if (now > endTime || isReleasedToPublic == true) { return true; } return false; } }