Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xFb2f26F266Fb2805a387230f2aa0a331b4d96Fba
Balance 0 ETH
Nonce 1
Code Size 9423 bytes
Indexed Transactions Index loading...
External Etherscan · Sourcify

Contract Bytecode

9423 bytes
0x606060405236156103565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146103b8578063095ea7b31461044257806312065fe01461047857806318160ddd1461049d5780632194f3a2146104b057806323b872dd146104df5780632cc82655146105075780632f73ef911461051f57806330074c6c14610532578063313ce5671461054557806334c1ef771461056e5780633882f333146105815780633f6f7ed61461059457806341affe19146105aa578063435263ef146105c057806345ab17bf146105d357806348546971146105e657806348c54b9d146105f95780634bae6f3f1461060c57806354fd4d501461062b57806359b36e3e1461063e5780635b715ae01461065d5780635b91c510146106705780636618846314610686578063687cc2fd146106a857806370a08231146106bb57806370c35951146106da57806371aa60fd146106ed5780637259bce3146107035780637376678b1461071657806373eda3cc14610729578063740404241461073c57806374817d9b146107525780637d0bd79a146107685780638a9cb3611461077b5780638da5cb5b1461078e578063903a3ef6146107a157806391667aef146107b457806395d89b41146107c7578063960524e3146107da5780639f550293146107ed578063a3fcf9bc14610800578063a9059cbb14610813578063ac50713a14610835578063af99a3271461084b578063b148313e1461085e578063b2b0210914610871578063ba6bbe5514610884578063bf251bc614610897578063c1075329146108aa578063c19d93fb146108cc578063c3c2686c14610903578063c417354814610919578063c5c4744c1461092c578063c7e046701461093f578063cd46abe414610952578063cd4b691414610965578063d1bb04331461097b578063d2d93f901461098e578063d5a632b5146109a1578063d73dd623146109c0578063d7e64c00146109e2578063da9590cb146109f5578063dd62ed3e14610a14578063e03c639c14610a39578063e55b55ce14610a58578063e624d19914610a6b578063e75dcb1914610a81578063ec4cd0cf14610a94578063f2fde38b14610aa7578063f54e7a4014610ac6578063fa89401a14610ae8578063fd72e22a14610b07575b600160275460ff16600a81111561036957fe5b14806103855750600260275460ff16600a81111561038357fe5b145b806103a05750600360275460ff16600a81111561039e57fe5b145b15156103ab57600080fd5b6103b53334610b1a565b50005b34156103c357600080fd5b6103cb610c97565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156104075780820151838201526020016103ef565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044d57600080fd5b610464600160a060020a0360043516602435610d35565b604051901515815260200160405180910390f35b341561048357600080fd5b61048b610da1565b60405190815260200160405180910390f35b34156104a857600080fd5b61048b610db0565b34156104bb57600080fd5b6104c3610db6565b604051600160a060020a03909116815260200160405180910390f35b34156104ea57600080fd5b610464600160a060020a0360043581169060243516604435610dc5565b341561051257600080fd5b61051d600435610edd565b005b341561052a57600080fd5b61048b610f22565b341561053d57600080fd5b61048b610f51565b341561055057600080fd5b610558610f57565b60405160ff909116815260200160405180910390f35b341561057957600080fd5b61048b610f60565b341561058c57600080fd5b61048b610f66565b341561059f57600080fd5b610464600435610f6c565b34156105b557600080fd5b6104c3600435610fa3565b34156105cb57600080fd5b6104c3610fcb565b34156105de57600080fd5b61051d610fda565b34156105f157600080fd5b61051d611029565b341561060457600080fd5b610464611058565b341561061757600080fd5b61048b600160a060020a03600435166111b0565b341561063657600080fd5b6103cb6111c2565b341561064957600080fd5b61048b600160a060020a036004351661122d565b341561066857600080fd5b6104c361123f565b341561067b57600080fd5b61051d60043561124e565b341561069157600080fd5b610464600160a060020a036004351660243561128b565b34156106b357600080fd5b61048b611385565b34156106c657600080fd5b61048b600160a060020a036004351661138b565b34156106e557600080fd5b61048b6113a6565b34156106f857600080fd5b61048b6004356113ac565b341561070e57600080fd5b61048b611419565b341561072157600080fd5b61051d61141f565b341561073457600080fd5b61051d61146b565b341561074757600080fd5b61051d6004356114b7565b341561075d57600080fd5b61051d6004356114e5565b341561077357600080fd5b61048b611514565b341561078657600080fd5b61048b61151a565b341561079957600080fd5b6104c3611520565b34156107ac57600080fd5b61051d61152f565b34156107bf57600080fd5b61048b61180f565b34156107d257600080fd5b6103cb61181d565b34156107e557600080fd5b61048b611888565b34156107f857600080fd5b61048b61188e565b341561080b57600080fd5b61048b611898565b341561081e57600080fd5b610464600160a060020a036004351660243561189e565b341561084057600080fd5b6104c3600435611962565b341561085657600080fd5b61051d611970565b341561086957600080fd5b61048b6119bc565b341561087c57600080fd5b61048b6119c2565b341561088f57600080fd5b61048b6119c8565b34156108a257600080fd5b61048b6119e8565b34156108b557600080fd5b61051d600160a060020a03600435166024356119ee565b34156108d757600080fd5b6108df611a3a565b6040518082600a8111156108ef57fe5b60ff16815260200191505060405180910390f35b341561090e57600080fd5b6104c3600435611a43565b341561092457600080fd5b61048b611a51565b341561093757600080fd5b61048b611a57565b341561094a57600080fd5b61048b611a5d565b341561095d57600080fd5b61048b611a63565b341561097057600080fd5b61048b600435611a69565b341561098657600080fd5b61048b611a97565b341561099957600080fd5b61048b611a9d565b34156109ac57600080fd5b610464600160a060020a0360043516611aa3565b34156109cb57600080fd5b610464600160a060020a0360043516602435611b41565b34156109ed57600080fd5b61048b611be5565b3415610a0057600080fd5b610464600160a060020a0360043516611beb565b3415610a1f57600080fd5b61048b600160a060020a0360043581169060243516611c4e565b3415610a4457600080fd5b610464600160a060020a0360043516611c79565b3415610a6357600080fd5b61048b611cdc565b3415610a7657600080fd5b6104c3600435611cfc565b3415610a8c57600080fd5b61048b611d0a565b3415610a9f57600080fd5b610464611d10565b3415610ab257600080fd5b61051d600160a060020a0360043516611d2c565b3415610ad157600080fd5b610464600160a060020a0360043516602435611dc7565b3415610af357600080fd5b610464600160a060020a0360043516611eea565b3415610b1257600080fd5b6104c361203c565b600080610b26836113ac565b9050801515610b3457600080fd5b610b3c61204b565b15610bbd57600160a060020a038416600090815260146020526040902054610b6a908263ffffffff61205416565b600160a060020a038516600090815260146020908152604080832093909355601590522054610b9f908463ffffffff61205416565b600160a060020a038516600090815260156020526040902055610c29565b600160a060020a0384166000908152601460205260409020541515610be657600e805460010190555b600160a060020a038416600090815260146020526040902054610c0f908263ffffffff61205416565b600160a060020a0385166000908152601460205260409020555b83600160a060020a031633600160a060020a03167ff370ff51765588b4b12b4ccf319b865dd3499a57df818acfe82c2740e41c878d858460405191825260208201526040908101905180910390a3610c808361206a565b610c8a83826121f3565b50600191505b5092915050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d2d5780601f10610d0257610100808354040283529160200191610d2d565b820191906000526020600020905b815481529060010190602001808311610d1057829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600160a060020a033016315b90565b60005481565b601f54600160a060020a031681565b600080600160a060020a0384161515610ddd57600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610e23908463ffffffff61230716565b600160a060020a038087166000908152600160205260408082209390935590861681522054610e58908463ffffffff61205416565b600160a060020a038516600090815260016020526040902055610e81818463ffffffff61230716565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616916000805160206124848339815191529086905190815260200160405180910390a3506001949350505050565b60035433600160a060020a03908116911614610ef857600080fd5b80600a811115610f0457fe5b6027805460ff1916600183600a811115610f1a57fe5b021790555050565b60035460009033600160a060020a03908116911614610f4057600080fd5b50601f54600160a060020a03163190565b60115481565b60065460ff1681565b60185481565b601b5481565b60035460009033600160a060020a03908116911614610f8a57600080fd5b620186a0821015610f9a57600080fd5b50601e55600190565b6026805482908110610fb157fe5b600091825260209091200154600160a060020a0316905081565b602054600160a060020a031681565b60035433600160a060020a03908116911614610ff557600080fd5b600660275460ff16600a81111561100857fe5b1461101257600080fd5b602780546009919060ff19166001835b0217905550565b60035433600160a060020a0390811691161461104457600080fd5b60278054600a919060ff1916600183611022565b600080600460275460ff16600a81111561106e57fe5b1461107857600080fd5b50600160a060020a03331660009081526014602052604081205490811161109e57600080fd5b600160a060020a03338116600090815260146020908152604080832083905560085490931682526001905220546110db908263ffffffff61230716565b600854600160a060020a03908116600090815260016020526040808220939093553390911681522054611114908263ffffffff61205416565b33600160a060020a03811660009081526001602052604090819020929092557fb3e6713eb4b9ebcedd171189507351d87329927e260601e1e1e9181e452b9b1391839051600160a060020a03909216825260208201526040908101905180910390a1600854600160a060020a0333811691166000805160206124848339815191528360405190815260200160405180910390a3600191505b5090565b60146020526000908152604090205481565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d2d5780601f10610d0257610100808354040283529160200191610d2d565b60156020526000908152604090205481565b602254600160a060020a031681565b60035433600160a060020a0390811691161461126957600080fd5b602780546002919060ff19166001835b021790555061128781610f6c565b5050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156112e857600160a060020a03338116600090815260026020908152604080832093881683529290529081205561131f565b6112f8818463ffffffff61230716565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60165481565b600160a060020a031660009081526001602052604090205490565b600b5481565b60006113b661204b565b156113d457601a54601e5483028115156113cc57fe5b049050611414565b6113dc612319565b156113f257601c54601e5483028115156113cc57fe5b6113fa612322565b1561141057601d54601e5483028115156113cc57fe5b5060005b919050565b601c5481565b60035433600160a060020a0390811691161461143a57600080fd5b600260275460ff16600a81111561144d57fe5b1461145757600080fd5b602780546007919060ff1916600183611022565b60035433600160a060020a0390811691161461148657600080fd5b600360275460ff16600a81111561149957fe5b146114a357600080fd5b602780546008919060ff1916600183611022565b60035433600160a060020a039081169116146114d257600080fd5b602780546001919060ff19168280611279565b60035433600160a060020a0390811691161461150057600080fd5b602780546003919060ff1916600183611279565b60195481565b60095481565b600854600160a060020a031681565b600354600090819033600160a060020a0390811691161461154f57600080fd5b600860275460ff16600a81111561156257fe5b1461156c57600080fd5b6027805460ff19166004179055602054600c5461159291600160a060020a03169061232b565b50602154600d546115ac91600160a060020a03169061232b565b50602254600b546115c691600160a060020a03169061232b565b5061162a602380548060200260200160405190810160405280929190818152602001828054801561162057602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311611602575b50505050506123f7565b50611633611cdc565b600060165591506116426119c8565b6000601881905590915082111561171057600654600854600160a060020a031660009081526001602052604090205460ff909116600a0a929092029161168e908363ffffffff61230716565b600854600160a060020a0390811660009081526001602090815260408083209490945554909116815220546116c9908363ffffffff61205416565b60208054600160a060020a03908116600090815260018352604080822094909455915416916000805160206124848339815191529085905190815260200160405180910390a35b60008111156117d657600654600854600160a060020a031660009081526001602052604090205460ff909116600a0a9190910290611754908263ffffffff61230716565b600854600160a060020a03908116600090815260016020908152604080832094909455549091168152205461178f908263ffffffff61205416565b60208054600160a060020a03908116600090815260018352604080822094909455915416916000805160206124848339815191529084905190815260200160405180910390a35b601f54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561128757600080fd5b601954601754601354010190565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d2d5780601f10610d0257610100808354040283529160200191610d2d565b600e5490565b6011546010540190565b600d5481565b6000600160a060020a03831615156118b557600080fd5b600160a060020a0333166000908152600160205260409020546118de908363ffffffff61230716565b600160a060020a033381166000908152600160205260408082209390935590851681522054611913908363ffffffff61205416565b600160a060020a0380851660008181526001602052604090819020939093559133909116906000805160206124848339815191529085905190815260200160405180910390a350600192915050565b6023805482908110610fb157fe5b60035433600160a060020a0390811691161461198b57600080fd5b600160275460ff16600a81111561199e57fe5b146119a857600080fd5b602780546006919060ff1916600183611022565b60135481565b60125481565b6000601854600014156119dd57506000610dad565b506019546018540390565b600a5481565b60035433600160a060020a03908116911614611a0957600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f19350505050151561128757600080fd5b60275460ff1681565b6025805482908110610fb157fe5b60105481565b600f5481565b601d5481565b600c5481565b6000816001430340604051908152602001604051908190039020811515611a8c57fe5b066001019050919050565b60175481565b601e5481565b60035460009033600160a060020a03908116911614611ac157600080fd5b600660275460ff16600a811115611ad457fe5b10611ade57600080fd5b600160a060020a0382161515611af357600080fd5b6024805460018101611b05838261244a565b5060009182526020909120018054600160a060020a03841673ffffffffffffffffffffffffffffffffffffffff19909116179055506001919050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054611b79908363ffffffff61205416565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600e5481565b60035460009033600160a060020a03908116911614611c0957600080fd5b600360275460ff16600a811115611c1c57fe5b1415611c2757600080fd5b600160a060020a0382161515611c3c57600080fd5b6026805460018101611b05838261244a565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035460009033600160a060020a03908116911614611c9757600080fd5b600260275460ff16600a811115611caa57fe5b1415611cb557600080fd5b600160a060020a0382161515611cca57600080fd5b6025805460018101611b05838261244a565b600060165460001415611cf157506000610dad565b506017546016540390565b6024805482908110610fb157fe5b601a5481565b600060045b60275460ff16600a811115611d2657fe5b14905090565b60035433600160a060020a03908116911614611d4757600080fd5b600160a060020a0381161515611d5c57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600090819033600160a060020a03908116911614611de757600080fd5b600160275460ff16600a811115611dfa57fe5b14611e0457600080fd5b60008311611e1157600080fd5b50600654600160a060020a03841660009081526014602052604090205460ff909116600a0a830290611e49908263ffffffff61205416565b600160a060020a038516600090815260146020526040902055601354611e75908463ffffffff61205416565b60138190556012549010611e91576027805460ff191660061790555b83600160a060020a031633600160a060020a03167ff370ff51765588b4b12b4ccf319b865dd3499a57df818acfe82c2740e41c878d60008460405191825260208201526040908101905180910390a35060019392505050565b600354600090819033600160a060020a03908116911614611f0a57600080fd5b600960275460ff16600a811115611f1d57fe5b14611f2757600080fd5b50600160a060020a038216600090815260156020526040812054908111611f4d57600080fd5b600160a060020a0383166000818152601560205260408082209190915582156108fc0290839051600060405180830381858888f193505050501515611fef57600160a060020a038316600090815260156020526040908190208290557fcb80bd6028ae0d018d1107f97dff976c4ec0eac08b0c0b0333ce6171b9a82363908490839051600160a060020a03909216825260208201526040908101905180910390a15b7fa333f96dabe0ec7cced63b2b2fb2c580f835a922775cb04895aeb146331c7ebb8382604051600160a060020a03909216825260208201526040908101905180910390a150600192915050565b602154600160a060020a031681565b60006001611d15565b60008282018381101561206357fe5b9392505050565b600080612075612319565b1561213057602554600090111561212b5760255460019061209590611a69565b0391506025828154811015156120a757fe5b600091825260209091200154600160a060020a031690508083156108fc0284604051600060405180830381858888f1935050505015156120e657600080fd5b7f35c019e24e057e2b74358b61c59c75be70dc488b1c5f97fd5b9dfe58f6df04e88184604051600160a060020a03909216825260208201526040908101905180910390a15b6121ee565b612138612322565b156121ee5760265460009011156121ee5760265460019061215890611a69565b03915060268281548110151561216a57fe5b600091825260209091200154600160a060020a031690508083156108fc0284604051600060405180830381858888f1935050505015156121a957600080fd5b7f35c019e24e057e2b74358b61c59c75be70dc488b1c5f97fd5b9dfe58f6df04e88184604051600160a060020a03909216825260208201526040908101905180910390a15b505050565b600654600090819060ff16600a0a8381151561220b57fe5b04905061221661204b565b156122575760135461222e908263ffffffff61205416565b6013819055601254901061225257602780546006919060ff19166001835b02179055505b610c90565b61225f612319565b156122af57601754612277908263ffffffff61205416565b60175560105461228d908563ffffffff61205416565b6010556016546017541061225257602780546007919060ff191660018361224c565b6122b7612322565b15610c90576019546122cf908263ffffffff61205416565b6019556011546122e5908563ffffffff61205416565b60115560185460195410610c9057506027805460ff1916600817905592915050565b60008282111561231357fe5b50900390565b60006002611d15565b60006003611d15565b6000808260095481151561233b57fe5b0460005481151561234857fe5b600854600160a060020a03166000908152600160205260409020549190049150612378908263ffffffff61230716565b600854600160a060020a0390811660009081526001602052604080822093909355908616815220546123b0908263ffffffff61205416565b600160a060020a0385166000818152600160205260408082209390935590916000805160206124848339815191529084905190815260200160405180910390a35092915050565b60008060008351600a5481151561240a57fe5b049150600090505b83518110156124435761243a84828151811061242a57fe5b906020019060200201518361232b565b50600101612412565b5050919050565b8154818355818115116121ee576000838152602090206121ee918101908301610dad91905b808211156111ac576000815560010161246f5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c800631c74f9d1cdc373473e3237ee226148685311820f356d34d77940e61b170029

Verified Source Code Partial Match

Compiler: v0.4.17+commit.bdeb9e52 Optimization: Yes (200 runs)
DadiToken.sol 931 lines
pragma solidity ^0.4.11;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal constant returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal constant returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

pragma solidity ^0.4.11;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    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 transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

pragma solidity ^0.4.11;


/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  uint256 public totalSupply;
  function balanceOf(address who) public constant returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}


pragma solidity ^0.4.11;


/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
  using SafeMath for uint256;

  mapping(address => uint256) balances;

  /**
  * @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));

    // SafeMath.sub will throw if there is not enough balance.
    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    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 constant returns (uint256 balance) {
    return balances[_owner];
  }

}

pragma solidity ^0.4.11;


/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) public constant returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

pragma solidity ^0.4.11;


/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) allowed;


  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    uint256 _allowance = allowed[_from][msg.sender];

    // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
    // require (_value <= _allowance);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   *
   * Beware that changing an allowance with this method brings the risk that someone may use both the old
   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }

  /**
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   */
  function increaseApproval (address _spender, uint _addedValue)
    returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  function decreaseApproval (address _spender, uint _subtractedValue)
    returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}

pragma solidity ^0.4.11;


/*****
* @title The ICO Contract
*/
contract DadiToken is StandardToken, Ownable {
    using SafeMath for uint256;

    /* Public variables of the token */
    string public name = "DADI";
    string public symbol = "DADI";
    uint8 public decimals = 18;
    string public version = "H1.0";

    address public owner;

    uint256 public hundredPercent = 1000;
    uint256 public foundersPercentOfTotal = 200;
    uint256 public referralPercentOfTotal = 50;
    uint256 public ecosystemPercentOfTotal = 25;
    uint256 public operationsPercentOfTotal = 25;

    uint256 public investorCount = 0;
    uint256 public totalRaised; // total ether raised (in wei)
    uint256 public preSaleRaised = 0; // ether raised (in wei)
    uint256 public publicSaleRaised = 0; // ether raised (in wei)

    // PartnerSale variables
    uint256 public partnerSaleTokensAvailable;
    uint256 public partnerSaleTokensPurchased = 0;
    mapping(address => uint256) public purchasedTokens;
    mapping(address => uint256) public partnerSaleWei;

    // PreSale variables
    uint256 public preSaleTokensAvailable;
    uint256 public preSaleTokensPurchased = 0;

    // PublicSale variables
    uint256 public publicSaleTokensAvailable;
    uint256 public publicSaleTokensPurchased = 0;

    // Price data
    uint256 public partnerSaleTokenPrice = 125;     // USD$0.125
    uint256 public partnerSaleTokenValue;
    uint256 public preSaleTokenPrice = 250;         // USD$0.25
    uint256 public publicSaleTokenPrice = 500;       // USD$0.50

    // ETH to USD Rate, set by owner: 1 ETH = ethRate USD
    uint256 public ethRate;

    // Address which will receive raised funds and owns the total supply of tokens
    address public fundsWallet;
    address public ecosystemWallet;
    address public operationsWallet;
    address public referralProgrammeWallet;
    address[] public foundingTeamWallets;
    
    address[] public partnerSaleWallets;
    address[] public preSaleWallets;
    address[] public publicSaleWallets;
   
    /*****
    * State machine
    *  0 - Preparing:            All contract initialization calls
    *  1 - PartnerSale:          Contract is in the invite-only PartnerSale Period
    *  6 - PartnerSaleFinalized: PartnerSale has completed
    *  2 - PreSale:              Contract is in the PreSale Period
    *  7 - PreSaleFinalized:     PreSale has completed
    *  3 - PublicSale:           The public sale of tokens, follows PreSale
    *  8 - PublicSaleFinalized:  The PublicSale has completed
    *  4 - Success:              ICO Successful
    *  5 - Failure:              Minimum funding goal not reached
    *  9 - Refunding:            Owner can transfer refunds
    * 10 - Closed:               ICO has finished, all tokens must have been claimed
    */
    enum SaleState { Preparing, PartnerSale, PreSale, PublicSale, Success, Failure, PartnerSaleFinalized, PreSaleFinalized, PublicSaleFinalized, Refunding, Closed }
    SaleState public state = SaleState.Preparing;

    /**
    * event for token purchase logging
    * @param purchaser who paid for the tokens
    * @param beneficiary who got the tokens
    * @param value weis paid for purchase
    * @param tokens amount of tokens purchased
    */
    event LogTokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 tokens);
    event LogRedistributeTokens(address recipient, SaleState state, uint256 tokens);
    event LogRefundProcessed(address recipient, uint256 value);
    event LogRefundFailed(address recipient, uint256 value);
    event LogClaimTokens(address recipient, uint256 tokens);
    event LogFundTransfer(address wallet, uint256 value);

    /*****
    * @dev Modifier to check that amount transferred is not 0
    */
    modifier nonZero() {
        require(msg.value != 0);
        _;
    }

    /*****
    * @dev The constructor function to initialize the token related properties
    * @param _wallet                        address     Specifies the address of the funding wallet
    * @param _operationalWallets            address[]   Specifies an array of addresses for [0] ecosystem, [1] operations, [2] referral programme
    * @param _foundingTeamWallets           address[]   Specifies an array of addresses of the founding team wallets
    * @param _initialSupply                 uint256     Specifies the total number of tokens available
    * @param _tokensAvailable               uint256[]   Specifies an array of tokens available for each phase, [0] PartnerSale, [1] PreSale, [2] PublicSale
    */
    function DadiToken (
        address _wallet,
        address[] _operationalWallets,
        address[] _foundingTeamWallets,
        uint256 _initialSupply,
        uint256[] _tokensAvailable
    ) public {
        require(_wallet != address(0));

        owner = msg.sender;
 
        // Token distribution per sale phase
        partnerSaleTokensAvailable = _tokensAvailable[0];
        preSaleTokensAvailable = _tokensAvailable[1];
        publicSaleTokensAvailable = _tokensAvailable[2];

        // Determine the actual supply using token amount * decimals
        totalSupply = _initialSupply * (uint256(10) ** decimals);

        // Give all the initial tokens to the contract owner
        balances[owner] = totalSupply;
        Transfer(0x0, owner, totalSupply);

        // Distribute tokens to the supporting operational wallets
        ecosystemWallet = _operationalWallets[0];
        operationsWallet = _operationalWallets[1];
        referralProgrammeWallet = _operationalWallets[2];
        foundingTeamWallets = _foundingTeamWallets;
        fundsWallet = _wallet;
        
        // Set a base ETHUSD rate
        updateEthRate(300000);
    }

    /*****
    * @dev Fallback Function to buy the tokens
    */
    function () payable {
        require(
            state == SaleState.PartnerSale || 
            state == SaleState.PreSale || 
            state == SaleState.PublicSale
        );

        buyTokens(msg.sender, msg.value);
    }

    /*****
    * @dev Allows transfer of tokens to a recipient who has purchased offline, during the PartnerSale
    * @param _recipient     address     The address of the recipient of the tokens
    * @param _tokens        uint256     The number of tokens purchased by the recipient
    * @return success       bool        Returns true if executed successfully
    */
    function offlineTransaction (address _recipient, uint256 _tokens) public onlyOwner returns (bool) {
        require(state == SaleState.PartnerSale);
        require(_tokens > 0);

        // Convert to a token with decimals 
        uint256 tokens = _tokens * (uint256(10) ** decimals);

        purchasedTokens[_recipient] = purchasedTokens[_recipient].add(tokens);

        // Use original _token argument to increase the count of tokens purchased in the PartnerSale
        partnerSaleTokensPurchased = partnerSaleTokensPurchased.add(_tokens);

        // Finalize the PartnerSale if necessary
        if (partnerSaleTokensPurchased >= partnerSaleTokensAvailable) {
            state = SaleState.PartnerSaleFinalized;
        }

        LogTokenPurchase(msg.sender, _recipient, 0, tokens);

        return true;
    }

    /*****
    * @dev Allow updating the ETH USD exchange rate
    * @param rate   uint256  the current ETH USD rate, multiplied by 1000
    * @return bool  Return true if the contract is in PartnerSale Period
    */
    function updateEthRate (uint256 rate) public onlyOwner returns (bool) {
        require(rate >= 100000);
        
        ethRate = rate;
        return true;
    }

    /*****
    * @dev Allows the contract owner to add a new PartnerSale wallet, used to hold funds safely
    *      Can only be performed in the Preparing state
    * @param _wallet        address     The address of the wallet
    * @return success       bool        Returns true if executed successfully
    */
    function addPartnerSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state < SaleState.PartnerSaleFinalized);
        require(_wallet != address(0));
        partnerSaleWallets.push(_wallet);
        return true;
    }

    /*****
    * @dev Allows the contract owner to add a new PreSale wallet, used to hold funds safely
    *      Can not be performed in the PreSale state
    * @param _wallet        address     The address of the wallet
    * @return success       bool        Returns true if executed successfully
    */
    function addPreSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state != SaleState.PreSale);
        require(_wallet != address(0));
        preSaleWallets.push(_wallet);
        return true;
    }

    /*****
    * @dev Allows the contract owner to add a new PublicSale wallet, used to hold funds safely
    *      Can not be performed in the PublicSale state
    * @param _wallet        address     The address of the wallet
    * @return success       bool        Returns true if executed successfully
    */
    function addPublicSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state != SaleState.PublicSale);
        require(_wallet != address(0));
        publicSaleWallets.push(_wallet);
        return true;
    }

    /*****
    * @dev Calculates the number of tokens that can be bought for the amount of Wei transferred
    * @param _amount    uint256     The amount of money invested by the investor
    * @return tokens    uint256     The number of tokens purchased for the amount invested
    */
    function calculateTokens (uint256 _amount) public returns (uint256 tokens) {
        if (isStatePartnerSale()) {
            tokens = _amount * ethRate / partnerSaleTokenPrice;
        } else if (isStatePreSale()) {
            tokens = _amount * ethRate / preSaleTokenPrice;
        } else if (isStatePublicSale()) {
            tokens = _amount * ethRate / publicSaleTokenPrice;
        } else {
            tokens = 0;
        }

        return tokens;
    }

    /*****
    * @dev Called by the owner of the contract to open the Partner/Pre/Crowd Sale periods
    */
    function setPhase (uint256 phase) public onlyOwner {
        state = SaleState(uint(phase));
    }

    /*****
    * @dev Called by the owner of the contract to start the Partner Sale
    * @param rate   uint256  the current ETH USD rate, multiplied by 1000
    */
    function startPartnerSale (uint256 rate) public onlyOwner {
        state = SaleState.PartnerSale;
        updateEthRate(rate);
    }

    /*****
    * @dev Called by the owner of the contract to start the Pre Sale
    * @param rate   uint256  the current ETH USD rate, multiplied by 1000
    */
    function startPreSale (uint256 rate) public onlyOwner {
        state = SaleState.PreSale;
        updateEthRate(rate);
    }

    /*****
    * @dev Called by the owner of the contract to start the Public Sale
    * @param rate   uint256  the current ETH USD rate, multiplied by 1000
    */
    function startPublicSale (uint256 rate) public onlyOwner {
        state = SaleState.PublicSale;
        updateEthRate(rate);
    }

    /*****
    * @dev Called by the owner of the contract to close the Partner Sale
    */
    function finalizePartnerSale () public onlyOwner {
        require(state == SaleState.PartnerSale);
        
        state = SaleState.PartnerSaleFinalized;
    }

    /*****
    * @dev Called by the owner of the contract to close the Pre Sale
    */
    function finalizePreSale () public onlyOwner {
        require(state == SaleState.PreSale);
        
        state = SaleState.PreSaleFinalized;
    }

    /*****
    * @dev Called by the owner of the contract to close the Public Sale
    */
    function finalizePublicSale () public onlyOwner {
        require(state == SaleState.PublicSale);
        
        state = SaleState.PublicSaleFinalized;
    }

    /*****
    * @dev Called by the owner of the contract to finalize the ICO
    *      and redistribute funds and unsold tokens
    */
    function finalizeIco () public onlyOwner {
        require(state == SaleState.PublicSaleFinalized);

        state = SaleState.Success;

        // 2.5% of total goes to DADI ecosystem
        distribute(ecosystemWallet, ecosystemPercentOfTotal);

        // 2.5% of total goes to DADI+ operations
        distribute(operationsWallet, operationsPercentOfTotal);

        // 5% of total goes to referral programme
        distribute(referralProgrammeWallet, referralPercentOfTotal);
        
        // 20% of total goes to the founding team wallets
        distributeFoundingTeamTokens(foundingTeamWallets);

        // redistribute unsold tokens to DADI ecosystem
        uint256 remainingPreSaleTokens = getPreSaleTokensAvailable();
        preSaleTokensAvailable = 0;
        
        uint256 remainingPublicSaleTokens = getPublicSaleTokensAvailable();
        publicSaleTokensAvailable = 0;

        // we need to represent the tokens with included decimals
        // `2640 ** (10 ^ 18)` not `2640`
        if (remainingPreSaleTokens > 0) {
            remainingPreSaleTokens = remainingPreSaleTokens * (uint256(10) ** decimals);
            balances[owner] = balances[owner].sub(remainingPreSaleTokens);
            balances[ecosystemWallet] = balances[ecosystemWallet].add(remainingPreSaleTokens);
            Transfer(0, ecosystemWallet, remainingPreSaleTokens);
        }

        if (remainingPublicSaleTokens > 0) {
            remainingPublicSaleTokens = remainingPublicSaleTokens * (uint256(10) ** decimals);
            balances[owner] = balances[owner].sub(remainingPublicSaleTokens);
            balances[ecosystemWallet] = balances[ecosystemWallet].add(remainingPublicSaleTokens);
            Transfer(0, ecosystemWallet, remainingPublicSaleTokens);
        }

        // Transfer ETH to the funding wallet.
        if (!fundsWallet.send(this.balance)) {
            revert();
        }
    }

    /*****
    * @dev Called by the owner of the contract to close the ICO
    *      and unsold tokens to the ecosystem wallet. No more tokens 
    *      may be claimed
    */
    function closeIco () public onlyOwner {
        state = SaleState.Closed;
    }
    

    /*****
    * @dev Allow investors to claim their tokens after the ICO is finalized & successful
    * @return   bool  Return true, if executed successfully
    */
    function claimTokens () public returns (bool) {
        require(state == SaleState.Success);
        
        // get the tokens available for the sender
        uint256 tokens = purchasedTokens[msg.sender];
        require(tokens > 0);

        purchasedTokens[msg.sender] = 0;

        balances[owner] = balances[owner].sub(tokens);
        balances[msg.sender] = balances[msg.sender].add(tokens);
      
        LogClaimTokens(msg.sender, tokens);
        Transfer(owner, msg.sender, tokens);
        return true;
    }

    /*****
    * @dev Allow investors to take their money back after a failure in the ICO
    * @param _recipient     address     The caller of the function who is looking for refund
    * @return               bool        Return true, if executed successfully
    */
    function refund (address _recipient) public onlyOwner returns (bool) {
        require(state == SaleState.Refunding);

        uint256 value = partnerSaleWei[_recipient];
        
        require(value > 0);

        partnerSaleWei[_recipient] = 0;

        if(!_recipient.send(value)) {
            partnerSaleWei[_recipient] = value;
            LogRefundFailed(_recipient, value);
        }

        LogRefundProcessed(_recipient, value);
        return true;
    }

    /*****
    * @dev Allows owner to withdraw funds from the contract balance for marketing purposes
    * @param _address       address     The recipient address for the ether
    * @return               bool        Return true, if executed successfully
    */
    function withdrawFunds (address _address, uint256 _amount) public onlyOwner {
        _address.transfer(_amount);
    }

    /*****
    * @dev Generates a random number from 1 to max based on the last block hash
    * @param max     uint  the maximum value 
    * @return a random number
    */
    function getRandom(uint max) public constant returns (uint randomNumber) {
        return (uint(sha3(block.blockhash(block.number - 1))) % max) + 1;
    }

    /*****
    * @dev Called by the owner of the contract to set the state to Refunding
    */
    function setRefunding () public onlyOwner {
        require(state == SaleState.PartnerSaleFinalized);
        
        state = SaleState.Refunding;
    }

    /*****
    * @dev Get the overall success state of the ICO
    * @return bool whether the state is successful, or not
    */
    function isSuccessful () public constant returns (bool) {
        return state == SaleState.Success;
    }

    /*****
    * @dev Get the amount of PreSale tokens left for purchase
    * @return uint256 the count of tokens available
    */
    function getPreSaleTokensAvailable () public constant returns (uint256) {
        if (preSaleTokensAvailable == 0) {
            return 0;
        }

        return preSaleTokensAvailable - preSaleTokensPurchased;
    }

    /*****
    * @dev Get the amount of PublicSale tokens left for purchase
    * @return uint256 the count of tokens available
    */
    function getPublicSaleTokensAvailable () public constant returns (uint256) {
        if (publicSaleTokensAvailable == 0) {
            return 0;
        }

        return publicSaleTokensAvailable - publicSaleTokensPurchased;
    }

    /*****
    * @dev Get the total count of tokens purchased in all the Sale periods
    * @return uint256 the count of tokens purchased
    */
    function getTokensPurchased () public constant returns (uint256) {
        return partnerSaleTokensPurchased + preSaleTokensPurchased + publicSaleTokensPurchased;
    }

    /*****
    * @dev Get the total amount raised in the PreSale and PublicSale periods
    * @return uint256 the amount raised, in Wei
    */
    function getTotalRaised () public constant returns (uint256) {
        return preSaleRaised + publicSaleRaised;
    }

    /*****
    * @dev Get the balance sent to the contract
    * @return uint256 the amount sent to this contract, in Wei
    */
    function getBalance () public constant returns (uint256) {
        return this.balance;
    }

    /*****
    * @dev Get the balance of the funds wallet used to transfer the final balance
    * @return uint256 the amount sent to the funds wallet at the end of the ICO, in Wei
    */
    function getFundsWalletBalance () public constant onlyOwner returns (uint256) {
        return fundsWallet.balance;
    }

    /*****
    * @dev Get the count of unique investors
    * @return uint256 the total number of unique investors
    */
    function getInvestorCount () public constant returns (uint256) {
        return investorCount;
    }

    /*****
    * @dev Send ether to the fund collection wallets
    */
    function forwardFunds (uint256 _value) internal {
        // if (isStatePartnerSale()) {
        //     // move funds to a partnerSaleWallet
        //     if (partnerSaleWallets.length > 0) {
        //         // Transfer ETH to a random wallet
        //         uint accountNumber = getRandom(partnerSaleWallets.length) - 1;
        //         address account = partnerSaleWallets[accountNumber];
        //         account.transfer(_value);
        //         LogFundTransfer(account, _value);
        //     }
        // }

        uint accountNumber;
        address account;

        if (isStatePreSale()) {
            // move funds to a preSaleWallet
            if (preSaleWallets.length > 0) {
                // Transfer ETH to a random wallet
                accountNumber = getRandom(preSaleWallets.length) - 1;
                account = preSaleWallets[accountNumber];
                account.transfer(_value);
                LogFundTransfer(account, _value);
            }
        } else if (isStatePublicSale()) {
            // move funds to a publicSaleWallet
            if (publicSaleWallets.length > 0) {
                // Transfer ETH to a random wallet
                accountNumber = getRandom(publicSaleWallets.length) - 1;
                account = publicSaleWallets[accountNumber];
                account.transfer(_value);
                LogFundTransfer(account, _value);
            }
        }
    }

    /*****
    * @dev Internal function to execute the token transfer to the recipient
    *      In the PartnerSale period, token balances are stored in a separate mapping, to
    *      await the PartnerSaleFinalized state, when investors may call claimTokens
    * @param _recipient     address     The address of the recipient of the tokens
    * @param _value         uint256     The amount invested by the recipient
    * @return success       bool        Returns true if executed successfully
    */
    function buyTokens (address _recipient, uint256 _value) internal returns (bool) {
        uint256 boughtTokens = calculateTokens(_value);
        require(boughtTokens != 0);

        if (isStatePartnerSale()) {
            // assign tokens to separate mapping
            purchasedTokens[_recipient] = purchasedTokens[_recipient].add(boughtTokens);
            partnerSaleWei[_recipient] = partnerSaleWei[_recipient].add(_value);
        } else {
            // increment the unique investor count
            if (purchasedTokens[_recipient] == 0) {
                investorCount++;
            }

            // assign tokens to separate mapping, that is not "balances"
            purchasedTokens[_recipient] = purchasedTokens[_recipient].add(boughtTokens);
        }

       
        LogTokenPurchase(msg.sender, _recipient, _value, boughtTokens);

        forwardFunds(_value);

        updateSaleParameters(_value, boughtTokens);

        return true;
    }

    /*****
    * @dev Internal function to modify parameters based on tokens bought
    * @param _value         uint256     The amount invested in exchange for the tokens
    * @param _tokens        uint256     The number of tokens purchased
    * @return success       bool        Returns true if executed successfully
    */
    function updateSaleParameters (uint256 _value, uint256 _tokens) internal returns (bool) {
        // we need to represent the integer value of tokens here
        // tokensPurchased = `2640`, not `2640 ** (10 ^ 18)`
        uint256 tokens = _tokens / (uint256(10) ** decimals);

        if (isStatePartnerSale()) {
            partnerSaleTokensPurchased = partnerSaleTokensPurchased.add(tokens);

            // No PartnerSale tokens remaining
            if (partnerSaleTokensPurchased >= partnerSaleTokensAvailable) {
                state = SaleState.PartnerSaleFinalized;
            }
        } else if (isStatePreSale()) {
            preSaleTokensPurchased = preSaleTokensPurchased.add(tokens);

            preSaleRaised = preSaleRaised.add(_value);

            // No PreSale tokens remaining
            if (preSaleTokensPurchased >= preSaleTokensAvailable) {
                state = SaleState.PreSaleFinalized;
            }
        } else if (isStatePublicSale()) {
            publicSaleTokensPurchased = publicSaleTokensPurchased.add(tokens);

            publicSaleRaised = publicSaleRaised.add(_value);

            // No PublicSale tokens remaining
            if (publicSaleTokensPurchased >= publicSaleTokensAvailable) {
                state = SaleState.PublicSaleFinalized;
            }
        }
    }

    /*****
    * @dev Internal calculation for the amount of Wei the specified tokens are worth
    * @param _tokens    uint256     The number of tokens purchased by the investor
    * @return amount    uint256     The amount the tokens are worth
    */
    function calculateValueFromTokens (uint256 _tokens) internal returns (uint256) {
        uint256 amount = _tokens.div(ethRate.div(partnerSaleTokenPrice));
        return amount;
    }

    /*****
    * @dev Private function to distribute tokens evenly amongst the founding team wallet addresses
    * @param _recipients    address[]   An array of founding team wallet addresses
    * @return success       bool        Returns true if executed successfully
    */
    function distributeFoundingTeamTokens (address[] _recipients) private returns (bool) {
        // determine the split between wallets
        // to arrive at a valid percentage we start the percentage the founding team has
        // available, which is 20% of the total supply. The percentage to distribute then is the
        // total percentage divided by the number of founding team wallets (likely 4).
        uint percentage = foundersPercentOfTotal / _recipients.length;

        for (uint i = 0; i < _recipients.length; i++) {
            distribute(_recipients[i], percentage);
        }
    }

    /*****
    * @dev Private function to move tokens to the specified wallet address
    * @param _recipient     address     The address of the wallet to move tokens to
    * @param percentage     uint        The percentage of the total supply of tokens to move
    * @return success       bool        Returns true if executed successfully
    */
    function distribute (address _recipient, uint percentage) private returns (bool) {
        uint256 tokens = totalSupply / (hundredPercent / percentage);

        balances[owner] = balances[owner].sub(tokens);
        balances[_recipient] = balances[_recipient].add(tokens);
        Transfer(0, _recipient, tokens);
    }

    /*****
    * @dev Check the PartnerSale state of the contract
    * @return bool  Return true if the contract is in the PartnerSale state
    */
    function isStatePartnerSale () private constant returns (bool) {
        return state == SaleState.PartnerSale;
    }

    /*****
    * @dev Check the PreSale state of the contract
    * @return bool  Return true if the contract is in the PreSale state
    */
    function isStatePreSale () private constant returns (bool) {
        return state == SaleState.PreSale;
    }

    /*****
    * @dev Check the PublicSale state of the contract
    * @return bool  Return true if the contract is in the PublicSale state
    */
    function isStatePublicSale () private constant returns (bool) {
        return state == SaleState.PublicSale;
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
ecosystemPercentOfTotal 0xcd46abe4 → uint256
ecosystemWallet 0x435263ef → address
ethRate 0xd2d93f90 → uint256
foundersPercentOfTotal 0xbf251bc6 → uint256
foundingTeamWallets 0xac50713a → address
fundsWallet 0x2194f3a2 → address
getBalance 0x12065fe0 → uint256
getFundsWalletBalance 0x2f73ef91 → uint256
getInvestorCount 0x960524e3 → uint256
getPreSaleTokensAvailable 0xe55b55ce → uint256
getPublicSaleTokensAvailable 0xba6bbe55 → uint256
getRandom 0xcd4b6914 → uint256
getTokensPurchased 0x91667aef → uint256
getTotalRaised 0x9f550293 → uint256
hundredPercent 0x8a9cb361 → uint256
investorCount 0xd7e64c00 → uint256
isSuccessful 0xec4cd0cf → bool
name 0x06fdde03 → string
operationsPercentOfTotal 0xa3fcf9bc → uint256
operationsWallet 0xfd72e22a → address
owner 0x8da5cb5b → address
partnerSaleTokenPrice 0xe75dcb19 → uint256
partnerSaleTokenValue 0x3882f333 → uint256
partnerSaleTokensAvailable 0xb2b02109 → uint256
partnerSaleTokensPurchased 0xb148313e → uint256
partnerSaleWallets 0xe624d199 → address
partnerSaleWei 0x59b36e3e → uint256
preSaleRaised 0xc4173548 → uint256
preSaleTokenPrice 0x7259bce3 → uint256
preSaleTokensAvailable 0x687cc2fd → uint256
preSaleTokensPurchased 0xd1bb0433 → uint256
preSaleWallets 0xc3c2686c → address
publicSaleRaised 0x30074c6c → uint256
publicSaleTokenPrice 0xc7e04670 → uint256
publicSaleTokensAvailable 0x34c1ef77 → uint256
publicSaleTokensPurchased 0x7d0bd79a → uint256
publicSaleWallets 0x41affe19 → address
purchasedTokens 0x4bae6f3f → uint256
referralPercentOfTotal 0x70c35951 → uint256
referralProgrammeWallet 0x5b715ae0 → address
state 0xc19d93fb → uint8
symbol 0x95d89b41 → string
totalRaised 0xc5c4744c → uint256
totalSupply 0x18160ddd → uint256
version 0x54fd4d50 → string

Write Contract 25 functions

These functions modify contract state and require a wallet transaction to execute.

addPartnerSaleWallet 0xd5a632b5
address _wallet
returns: bool
addPreSaleWallet 0xe03c639c
address _wallet
returns: bool
addPublicSaleWallet 0xda9590cb
address _wallet
returns: bool
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
calculateTokens 0x71aa60fd
uint256 _amount
returns: uint256
claimTokens 0x48c54b9d
No parameters
returns: bool
closeIco 0x48546971
No parameters
decreaseApproval 0x66188463
address _spender
uint256 _subtractedValue
returns: bool
finalizeIco 0x903a3ef6
No parameters
finalizePartnerSale 0xaf99a327
No parameters
finalizePreSale 0x7376678b
No parameters
finalizePublicSale 0x73eda3cc
No parameters
increaseApproval 0xd73dd623
address _spender
uint256 _addedValue
returns: bool
offlineTransaction 0xf54e7a40
address _recipient
uint256 _tokens
returns: bool
refund 0xfa89401a
address _recipient
returns: bool
setPhase 0x2cc82655
uint256 phase
setRefunding 0x45ab17bf
No parameters
startPartnerSale 0x74040424
uint256 rate
startPreSale 0x5b91c510
uint256 rate
startPublicSale 0x74817d9b
uint256 rate
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateEthRate 0x3f6f7ed6
uint256 rate
returns: bool
withdrawFunds 0xc1075329
address _address
uint256 _amount

Recent Transactions

Transaction index is loading. Only unfinalized transactions are shown while the index starts up.