diff --git a/src/dapp/app/controllers/CoinAdmin.js b/src/dapp/app/controllers/CoinAdmin.js index f5a0315..444eaf3 100644 --- a/src/dapp/app/controllers/CoinAdmin.js +++ b/src/dapp/app/controllers/CoinAdmin.js @@ -166,6 +166,26 @@ app.controller("CoinAdminCtrl", ['$scope', 'web3', 'ico', '$rootScope', function }); }; + $scope.setPriceForCustomer = function (userAddress, price) { + if (!userAddress) { + return alert( "User Address is required."); + } + + if (!price) { + return alert( "price is required."); + } + + + ico.setPriceForCustomer(userAddress, price, function (err, response) { + if (err) { + alert(err); + return; + } + + alert("The transaction has been submitted. Please wait till the next blocks are mined and check if the custom price setting was successful."); + }); + }; + $scope.takeOwnership = function () { console.log("taking ownership"); ico.takeOwnership(function (err) { @@ -275,6 +295,22 @@ app.controller("CoinAdminCtrl", ['$scope', 'web3', 'ico', '$rootScope', function }); }; + $scope.checkPriceForCustomer = function (address) { + + $scope.showPriceCheckResult = false; + $scope.priceCheckAddress = address; + ico.checkPriceForCustomer(address, function (err, response) { + if (err) { + alert(err); + return; + } + + $scope.customPrice = response; + $scope.showPriceCheckResult = true; + $scope.$apply(); + }); + }; + $rootScope.$on("new-block", function (event) { updateDetails(); }); diff --git a/src/dapp/app/controllers/WalletCtrl.js b/src/dapp/app/controllers/WalletCtrl.js index c93afa3..de3c250 100644 --- a/src/dapp/app/controllers/WalletCtrl.js +++ b/src/dapp/app/controllers/WalletCtrl.js @@ -11,6 +11,14 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc } $scope.currentPrice = price; + + ico.checkPriceForCustomer(web3.eth.accounts[0], function (err, result) { + if (result > 0) { + $scope.currentPrice = result; + $scope.$apply(); + } + }); + $scope.$apply(); }); @@ -29,7 +37,12 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc updateBalance(); }); - updateBalance(); + updateData(); + + function updateData() { + updateBalance(); + // updatePrice(); + } $scope.updatePrice = function(ethAmount) { $scope.tokenAmount = ethAmount / $scope.currentPrice; @@ -48,7 +61,6 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc $scope.displayConfirmData = true; $scope.contractAddress = details.contractAddress; $scope.buyTokenData = details.tranData; - console.log(ico.contractAddress); }); } }; diff --git a/src/dapp/app/partials/coin-admin.html b/src/dapp/app/partials/coin-admin.html index 4635426..0fd2b2b 100644 --- a/src/dapp/app/partials/coin-admin.html +++ b/src/dapp/app/partials/coin-admin.html @@ -193,4 +193,27 @@

Whitelist + +
+

Custom Price

+

A custom price can be set for each user. If price is set to 0, then the default price is used.

+
+
+ + +
+
+ + +
+
+

+ Custom Price is {{ customPrice }} ETH/Token +

+ + + +
\ No newline at end of file diff --git a/src/dapp/app/services/ico.js b/src/dapp/app/services/ico.js index db45365..2a885af 100644 --- a/src/dapp/app/services/ico.js +++ b/src/dapp/app/services/ico.js @@ -138,6 +138,13 @@ }); } + function setPriceForCustomer(customerAddress, price, next) { + var wei = web3.toWei(price, "ether"); + ico.setPriceForCustomer.sendTransaction(customerAddress, wei, function (err, result) { + next(err, result); + }); + } + function enableWhitelist(next) { ico.enableWhitelist.sendTransaction(next); } @@ -222,6 +229,20 @@ }); } + function checkPriceForCustomer(address, next) { + getICO().then(function (ico) { + ico.customerPrice(address, function (err, result) { + if (err) { + return next(err); + } + + next(null, web3.fromWei(result)); + }); + }, function (err) { + console.error(err); + }); + } + function whitelistEnabled(next) { getICO().then(function (ico) { ico.whitelistEnabled(function (err, result) { @@ -376,6 +397,8 @@ disableWhitelist: disableWhitelist, pauseICO: pauseICO, takeOwnership: takeOwnership, + setPriceForCustomer: setPriceForCustomer, + checkPriceForCustomer: checkPriceForCustomer, unpauseICO: unpauseICO }; }]); diff --git a/src/dapp/public/PreICO.json b/src/dapp/public/PreICO.json index 3fe9cc7..88e832b 100644 --- a/src/dapp/public/PreICO.json +++ b/src/dapp/public/PreICO.json @@ -72,7 +72,7 @@ "type": "bool" } ], - "payable": true, + "payable": false, "type": "function" }, { @@ -104,11 +104,11 @@ { "constant": true, "inputs": [], - "name": "INITIAL_SUPPLY", + "name": "decimals", "outputs": [ { "name": "", - "type": "uint256" + "type": "uint8" } ], "payable": false, @@ -117,11 +117,11 @@ { "constant": true, "inputs": [], - "name": "decimals", + "name": "minPurchase", "outputs": [ { "name": "", - "type": "uint8" + "type": "uint256" } ], "payable": false, @@ -130,20 +130,29 @@ { "constant": true, "inputs": [], - "name": "minPurchase", + "name": "purchasesEnabled", "outputs": [ { "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, "type": "function" }, { - "constant": true, - "inputs": [], - "name": "purchasesEnabled", + "constant": false, + "inputs": [ + { + "name": "customerAddress", + "type": "address" + }, + { + "name": "price", + "type": "uint256" + } + ], + "name": "setPriceForCustomer", "outputs": [ { "name": "", @@ -296,11 +305,11 @@ "constant": true, "inputs": [ { - "name": "eth", - "type": "uint256" + "name": "", + "type": "address" } ], - "name": "calculatTokens", + "name": "customerPrice", "outputs": [ { "name": "", @@ -349,6 +358,28 @@ "payable": false, "type": "function" }, + { + "constant": true, + "inputs": [ + { + "name": "eth", + "type": "uint256" + }, + { + "name": "tokenPrice", + "type": "uint256" + } + ], + "name": "calculateTokens", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "type": "function" + }, { "constant": false, "inputs": [ @@ -605,7 +636,16 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { + "name": "initialSupply", + "type": "uint256" + }, + { + "name": "price", + "type": "uint256" + } + ], "payable": false, "type": "constructor" }, @@ -721,877 +761,8 @@ "type": "event" } ], - "unlinked_binary": "0x60606040526004805460a060020a60ff0219169055341561001f57600080fd5b5b5b5b60038054600160a060020a03191633600160a060020a03161790555b6006805460ff191690555b69d3c21bcecceda100000060008181556006805461010060a860020a03191661010033600160a060020a039081168202929092179283905590910416815260016020819052604090912091909155671bc16d674ec800006008556009805460ff191690911790555b5b611d16806100c16000396000f300606060405236156101c75763ffffffff60e060020a60003504166306fdde0381146101cf578063095ea7b31461025a57806318160ddd1461029057806318fd8903146102b557806323b872dd146102e35780632ff2e9dc1461031f578063313ce5671461034457806333b5b62e1461036d5780633944fc8e146103925780633f4ba83a146103b95780634e6630b0146103ce5780634e71e0c8146103f3578063518ab2a81461040857806351fb012d1461042d5780635c975abb146104545780635f281bfb1461047b57806366188463146104a057806367cd7261146104d657806370a082311461050257806370ee3bbd146105335780638456cb591461055b5780638ab1d681146105705780638da5cb5b146105a357806391b7f5ed146105d257806395d89b41146105fc5780639b19251a14610687578063a0ef91df146106ba578063a9059cbb146106e1578063c8b0812514610717578063cdfb2b4e1461073c578063d0e30db014610763578063d0febe4c1461077f578063d6b0f4841461079b578063d73dd623146107c2578063dd62ed3e146107f8578063e30c39781461082f578063e43252d71461085e578063e8307d0014610891578063f2fde38b146108bb575b5b600080fd5b005b34156101da57600080fd5b6101e26108dc565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561021f5780820151818401525b602001610206565b50505050905090810190601f16801561024c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026557600080fd5b61027c600160a060020a0360043516602435610913565b604051901515815260200160405180910390f35b341561029b57600080fd5b6102a36109a3565b60405190815260200160405180910390f35b61027c600160a060020a03600435166024356044356109a9565b604051901515815260200160405180910390f35b34156102ee57600080fd5b61027c600160a060020a0360043581169060243516604435610a8e565b604051901515815260200160405180910390f35b341561032a57600080fd5b6102a3610b22565b60405190815260200160405180910390f35b341561034f57600080fd5b610357610b30565b60405160ff909116815260200160405180910390f35b341561037857600080fd5b6102a3610b35565b60405190815260200160405180910390f35b341561039d57600080fd5b61027c610b3b565b604051901515815260200160405180910390f35b34156103c457600080fd5b6101cd610b44565b005b34156103d957600080fd5b6102a3610bc6565b60405190815260200160405180910390f35b34156103fe57600080fd5b6101cd610bcc565b005b341561041357600080fd5b6102a3610c5c565b60405190815260200160405180910390f35b341561043857600080fd5b61027c610c83565b604051901515815260200160405180910390f35b341561045f57600080fd5b61027c610c8c565b604051901515815260200160405180910390f35b341561048657600080fd5b6102a3610c9c565b60405190815260200160405180910390f35b34156104ab57600080fd5b61027c600160a060020a0360043516602435610ca3565b604051901515815260200160405180910390f35b34156104e157600080fd5b61027c6004351515610d33565b604051901515815260200160405180910390f35b341561050d57600080fd5b6102a3600160a060020a0360043516610d66565b60405190815260200160405180910390f35b341561053e57600080fd5b6102a3600435610d85565b60405190815260200160405180910390f35b341561056657600080fd5b6101cd610db6565b005b341561057b57600080fd5b61027c600160a060020a0360043516610e3d565b604051901515815260200160405180910390f35b34156105ae57600080fd5b6105b6610eba565b604051600160a060020a03909116815260200160405180910390f35b34156105dd57600080fd5b61027c600435610ece565b604051901515815260200160405180910390f35b341561060757600080fd5b6101e2610efb565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561021f5780820151818401525b602001610206565b50505050905090810190601f16801561024c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561069257600080fd5b61027c600160a060020a0360043516610f32565b604051901515815260200160405180910390f35b34156106c557600080fd5b61027c610f47565b604051901515815260200160405180910390f35b34156106ec57600080fd5b61027c600160a060020a0360043516602435610fac565b604051901515815260200160405180910390f35b341561072257600080fd5b6102a361103c565b60405190815260200160405180910390f35b341561074757600080fd5b61027c611060565b604051901515815260200160405180910390f35b61027c611094565b604051901515815260200160405180910390f35b61027c6110bf565b604051901515815260200160405180910390f35b34156107a657600080fd5b61027c6115a4565b604051901515815260200160405180910390f35b34156107cd57600080fd5b61027c600160a060020a03600435166024356115d4565b604051901515815260200160405180910390f35b341561080357600080fd5b6102a3600160a060020a0360043581169060243516611664565b60405190815260200160405180910390f35b341561083a57600080fd5b6105b6611691565b604051600160a060020a03909116815260200160405180910390f35b341561086957600080fd5b61027c600160a060020a03600435166116a0565b604051901515815260200160405180910390f35b341561089c57600080fd5b61027c600435611720565b604051901515815260200160405180910390f35b34156108c657600080fd5b6101cd600160a060020a036004351661174d565b005b60408051908101604052600881527f424220546f6b656e000000000000000000000000000000000000000000000000602082015281565b60065460009060ff1615156109345761092c8383611795565b90505b61099a565b600160a060020a03331660009081526005602052604090205460ff1615156001141561096c5761092c8383611795565b90505b61099a565b60035433600160a060020a03908116911614156101c75761092c8383611795565b90505b61099a565b600080fd5b5b5b5b92915050565b60005481565b60035460009033600160a060020a039081169116146109c757600080fd5b600160a060020a03841615156109dc57600080fd5b600160a060020a03301631839010156109f457600080fd5b600160a060020a03841660009081526001602052604090205482901015610a1a57600080fd5b600160a060020a038085166000818152600160205260408082208054879003905560065461010090049093168152829020805485019055600a805486900390559084156108fc0290859051600060405180830381858888f193505050501515610a8257600080fd5b5060015b5b9392505050565b60065460009060ff161515610ab057610aa88484846117c3565b90505b610a86565b600160a060020a03331660009081526005602052604090205460ff16151560011415610ae957610aa88484846117c3565b90505b610a86565b60035433600160a060020a03908116911614156101c757610aa88484846117c3565b90505b610a86565b600080fd5b5b5b5b9392505050565b69d3c21bcecceda100000081565b601281565b60075481565b60095460ff1681565b60035433600160a060020a03908116911614610b5f57600080fd5b60045460a060020a900460ff161515610b7757600080fd5b6004805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15b5b5b565b600a5481565b60045433600160a060020a03908116911614610be757600080fd5b600454600354600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b5b565b6006546101009004600160a060020a03166000908152600160205260408120549054035b90565b60065460ff1681565b60045460a060020a900460ff1681565b6008545b90565b60065460009060ff161515610cc45761092c83836117f3565b90505b61099a565b600160a060020a03331660009081526005602052604090205460ff16151560011415610cfc5761092c83836117f3565b90505b61099a565b60035433600160a060020a03908116911614156101c75761092c83836117f3565b90505b61099a565b600080fd5b5b5b5b92915050565b60035460009033600160a060020a03908116911614610d5157600080fd5b6009805460ff19168315151790555b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600854600090600a90670de0b6b3a764000090610da28583611821565b811515610dab57fe5b0492505b5050919050565b60035433600160a060020a03908116911614610dd157600080fd5b60045460a060020a900460ff1615610de857600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15b5b5b565b60035460009033600160a060020a03908116911614610e5b57600080fd5b600160a060020a0380831660008181526005602052604090819020805460ff19169055600354909216917fd288ab5da2e1f37cf384a1565a3f905ad289b092fbdd31950dbbfef148c04f88905160405180910390a35060015b5b919050565b6006546101009004600160a060020a031681565b60035460009033600160a060020a03908116911614610eec57600080fd5b50600881905560015b5b919050565b60408051908101604052600581527f4242544f4b000000000000000000000000000000000000000000000000000000602082015281565b60056020526000908152604090205460ff1681565b600354600090819033600160a060020a03908116911614610f6757600080fd5b50600a80546000909155600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610fa257600080fd5b600191505b5b5090565b60065460009060ff161515610fcd5761092c8383611850565b90505b61099a565b600160a060020a03331660009081526005602052604090205460ff161515600114156110055761092c8383611850565b90505b61099a565b60035433600160a060020a03908116911614156101c75761092c8383611850565b90505b61099a565b600080fd5b5b5b5b92915050565b6006546101009004600160a060020a03166000908152600160205260409020545b90565b60035460009033600160a060020a0390811691161461107e57600080fd5b506006805460ff191660019081179091555b5b90565b60035460009033600160a060020a039081169116146110b257600080fd5b600a8054340190555b5b90565b600654600090819060ff1615156112515760045460a060020a900460ff16156110e757600080fd5b60095460ff1615156110f857600080fd5b600754341161110657600080fd5b600a805434908101909155600160a060020a033016906370ee3bbd9060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561116157600080fd5b6102c65a03f1151561117257600080fd5b50505060405180516006546101009004600160a060020a0316600090815260016020526040902054909250829010801591506111ae5750600081115b80156111d35750600160a060020a033316600090815260016020526040902054818101115b1561124557600160a060020a033381166000818152600160205260408082208054860190556006805461010090819004861684529282902080548790039055549293919092041690600080516020611ccb8339815191529084905190815260200160405180910390a36001915061124a565b600091505b5b5b610fa7565b600160a060020a03331660009081526005602052604090205460ff161515600114156113fc5760045460a060020a900460ff16156110e757600080fd5b60095460ff1615156110f857600080fd5b600754341161110657600080fd5b600a805434908101909155600160a060020a033016906370ee3bbd9060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561116157600080fd5b6102c65a03f1151561117257600080fd5b50505060405180516006546101009004600160a060020a0316600090815260016020526040902054909250829010801591506111ae5750600081115b80156111d35750600160a060020a033316600090815260016020526040902054818101115b1561124557600160a060020a033381166000818152600160205260408082208054860190556006805461010090819004861684529282902080548790039055549293919092041690600080516020611ccb8339815191529084905190815260200160405180910390a36001915061124a565b6000915061124a565b5b5b610fa7565b60035433600160a060020a03908116911614156101c75760045460a060020a900460ff16156110e757600080fd5b60095460ff1615156110f857600080fd5b600754341161110657600080fd5b600a805434908101909155600160a060020a033016906370ee3bbd9060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561116157600080fd5b6102c65a03f1151561117257600080fd5b50505060405180516006546101009004600160a060020a0316600090815260016020526040902054909250829010801591506111ae5750600081115b80156111d35750600160a060020a033316600090815260016020526040902054818101115b1561124557600160a060020a033381166000818152600160205260408082208054860190556006805461010090819004861684529282902080548790039055549293919092041690600080516020611ccb8339815191529084905190815260200160405180910390a36001915061124a565b6000915061124a565b5b5b610fa7565b600080fd5b5b5b5b5090565b60035460009033600160a060020a039081169116146115c257600080fd5b506006805460ff1916905560015b5b90565b60065460009060ff1615156115f55761092c838361187e565b90505b61099a565b600160a060020a03331660009081526005602052604090205460ff1615156001141561162d5761092c838361187e565b90505b61099a565b60035433600160a060020a03908116911614156101c75761092c838361187e565b90505b61099a565b600080fd5b5b5b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b600454600160a060020a031681565b60035460009033600160a060020a039081169116146116be57600080fd5b600160a060020a0380831660008181526005602052604090819020805460ff19166001179055600354909216917f0c4b48e75a1f7ab0a9a2f786b5d6c1f7789020403bff177fb54d46edb89ccc00905160405180910390a35060015b5b919050565b60035460009033600160a060020a0390811691161461173e57600080fd5b50600781905560015b5b919050565b60035433600160a060020a0390811691161461176857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60045460009060a060020a900460ff16156117af57600080fd5b6117b983836118ac565b90505b5b92915050565b60045460009060a060020a900460ff16156117dd57600080fd5b6117e8848484611919565b90505b5b9392505050565b60045460009060a060020a900460ff161561180d57600080fd5b6117b98383611a33565b90505b5b92915050565b600082820283158061183d575082848281151561183a57fe5b04145b151561184557fe5b8091505b5092915050565b60045460009060a060020a900460ff161561186a57600080fd5b6117b98383611b2f565b90505b5b92915050565b60045460009060a060020a900460ff161561189857600080fd5b6117b98383611bf4565b90505b5b92915050565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600080600160a060020a038416151561193157600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054611977908463ffffffff611c9916565b600160a060020a0380871660009081526001602052604080822093909355908616815220546119ac908463ffffffff611cb016565b600160a060020a0385166000908152600160205260409020556119d5818463ffffffff611c9916565b600160a060020a0380871660008181526002602090815260408083203386168452909152908190209390935590861691600080516020611ccb8339815191529086905190815260200160405180910390a3600191505b509392505050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115611a9057600160a060020a033381166000908152600260209081526040808320938816835292905290812055611ac7565b611aa0818463ffffffff611c9916565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b6000600160a060020a0383161515611b4657600080fd5b600160a060020a033316600090815260016020526040902054611b6f908363ffffffff611c9916565b600160a060020a033381166000908152600160205260408082209390935590851681522054611ba4908363ffffffff611cb016565b600160a060020a038085166000818152600160205260409081902093909355913390911690600080516020611ccb8339815191529085905190815260200160405180910390a35060015b92915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054611c2c908363ffffffff611cb016565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060015b92915050565b600082821115611ca557fe5b508082035b92915050565b60008282018381101561184557fe5b8091505b50929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208c1ca2ed5b8ffc3d129e2afdc5953199f948cbef329eea3ad0743b6d741a4f9b0029", - "networks": { - "101010": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x19b887607c47090446c6b44ed491bbe6d2fdcd3a", - "updated_at": 1506550532834 - }, - "1506459202566": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x72612efa36ce696fc882d713ad615112c3288410", - "updated_at": 1506459247207 - }, - "1506464560786": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0xefe4bfafe1ad600e86b6e679916338d776636579", - "updated_at": 1506466196821 - }, - "1506466539168": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x72612efa36ce696fc882d713ad615112c3288410", - "updated_at": 1506466549200 - }, - "1506502061338": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x72612efa36ce696fc882d713ad615112c3288410", - "updated_at": 1506502122723 - }, - "1506548652483": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x72612efa36ce696fc882d713ad615112c3288410", - "updated_at": 1506548710057 - }, - "1506583413414": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x72612efa36ce696fc882d713ad615112c3288410", - "updated_at": 1506583462231 - }, - "1507231453614": { - "events": { - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0x979e5217aac09fb9f1028217474f30fbef215e9b", - "updated_at": 1507235077126 - }, - "1507244025769": { - "events": { - "0x0c4b48e75a1f7ab0a9a2f786b5d6c1f7789020403bff177fb54d46edb89ccc00": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "user", - "type": "address" - }, - { - "indexed": true, - "name": "owner", - "type": "address" - } - ], - "name": "AddedToWhitelist", - "type": "event" - }, - "0xd288ab5da2e1f37cf384a1565a3f905ad289b092fbdd31950dbbfef148c04f88": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "user", - "type": "address" - }, - { - "indexed": true, - "name": "owner", - "type": "address" - } - ], - "name": "RemovedFromWhitelist", - "type": "event" - }, - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0xa7233b8e0516e8e6408ee091734e7c5d33149d57", - "updated_at": 1507246620498 - }, - "1507246686050": { - "events": { - "0x0c4b48e75a1f7ab0a9a2f786b5d6c1f7789020403bff177fb54d46edb89ccc00": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "user", - "type": "address" - }, - { - "indexed": true, - "name": "owner", - "type": "address" - } - ], - "name": "AddedToWhitelist", - "type": "event" - }, - "0xd288ab5da2e1f37cf384a1565a3f905ad289b092fbdd31950dbbfef148c04f88": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "user", - "type": "address" - }, - { - "indexed": true, - "name": "owner", - "type": "address" - } - ], - "name": "RemovedFromWhitelist", - "type": "event" - }, - "0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625": { - "anonymous": false, - "inputs": [], - "name": "Pause", - "type": "event" - }, - "0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33": { - "anonymous": false, - "inputs": [], - "name": "Unpause", - "type": "event" - }, - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - }, - "links": {}, - "address": "0xd1fcc87b23dc4b64da427736ae3c5a42197d1cad", - "updated_at": 1507251633156 - } - }, + "unlinked_binary": "0x60606040526004805460a060020a60ff0219169055341561001f57600080fd5b604051604080611c2a83398101604052808051919060200180519150505b5b5b60038054600160a060020a03191633600160a060020a03161790555b6006805460ff191690555b670de0b6b3a7640000820260008181556006805461010060a860020a03191661010033600160a060020a03908116820292909217928390559091041681526001602081905260409091209190915560088290556009805460ff191690911790555b50505b611b51806100d96000396000f300606060405236156101eb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101f8578063095ea7b31461028357806318160ddd146102b957806318fd8903146102de57806323b872dd14610317578063313ce5671461035357806333b5b62e1461037c5780633944fc8e146103a15780633d9da1b3146103c85780633f4ba83a146103fe5780634e6630b0146104135780634e71e0c814610438578063518ab2a81461044d57806351fb012d146104725780635c975abb146104995780635f281bfb146104c057806366188463146104e557806367cd72611461051b57806370a082311461054757806379a7600e146105785780638456cb59146105a95780638ab1d681146105be5780638da5cb5b146105f1578063903cc5831461062057806391b7f5ed1461064b57806395d89b41146106755780639b19251a14610700578063a0ef91df14610733578063a9059cbb1461075a578063c8b0812514610790578063cdfb2b4e146107b5578063d0e30db0146107dc578063d0febe4c146107f8578063d6b0f48414610814578063d73dd6231461083b578063dd62ed3e14610871578063e30c3978146108a8578063e43252d7146108d7578063e8307d001461090a578063f2fde38b14610934575b5b6101f4610955565b505b005b341561020357600080fd5b61020b610b2c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102485780820151818401525b60200161022f565b50505050905090810190601f1680156102755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028e57600080fd5b6102a5600160a060020a0360043516602435610b63565b604051901515815260200160405180910390f35b34156102c457600080fd5b6102cc610bf3565b60405190815260200160405180910390f35b34156102e957600080fd5b6102a5600160a060020a0360043516602435604435610bf9565b604051901515815260200160405180910390f35b341561032257600080fd5b6102a5600160a060020a0360043581169060243516604435610cf8565b604051901515815260200160405180910390f35b341561035e57600080fd5b610366610d8c565b60405160ff909116815260200160405180910390f35b341561038757600080fd5b6102cc610d91565b60405190815260200160405180910390f35b34156103ac57600080fd5b6102a5610d97565b604051901515815260200160405180910390f35b34156103d357600080fd5b6102a5600160a060020a0360043516602435610da0565b604051901515815260200160405180910390f35b341561040957600080fd5b6101f6610df2565b005b341561041e57600080fd5b6102cc610e74565b60405190815260200160405180910390f35b341561044357600080fd5b6101f6610e83565b005b341561045857600080fd5b6102cc610ee4565b60405190815260200160405180910390f35b341561047d57600080fd5b6102a5610f0b565b604051901515815260200160405180910390f35b34156104a457600080fd5b6102a5610f14565b604051901515815260200160405180910390f35b34156104cb57600080fd5b6102cc610f24565b60405190815260200160405180910390f35b34156104f057600080fd5b6102a5600160a060020a0360043516602435610f2b565b604051901515815260200160405180910390f35b341561052657600080fd5b6102a56004351515610fbb565b604051901515815260200160405180910390f35b341561055257600080fd5b6102cc600160a060020a0360043516610fee565b60405190815260200160405180910390f35b341561058357600080fd5b6102cc600160a060020a036004351661100d565b60405190815260200160405180910390f35b34156105b457600080fd5b6101f661101f565b005b34156105c957600080fd5b6102a5600160a060020a03600435166110a6565b604051901515815260200160405180910390f35b34156105fc57600080fd5b610604611123565b604051600160a060020a03909116815260200160405180910390f35b341561062b57600080fd5b6102cc600435602435611137565b60405190815260200160405180910390f35b341561065657600080fd5b6102a5600435611161565b604051901515815260200160405180910390f35b341561068057600080fd5b61020b61118e565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102485780820151818401525b60200161022f565b50505050905090810190601f1680156102755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561070b57600080fd5b6102a5600160a060020a03600435166111c5565b604051901515815260200160405180910390f35b341561073e57600080fd5b6102a56111da565b604051901515815260200160405180910390f35b341561076557600080fd5b6102a5600160a060020a036004351660243561123d565b604051901515815260200160405180910390f35b341561079b57600080fd5b6102cc6112cd565b60405190815260200160405180910390f35b34156107c057600080fd5b6102a56112f1565b604051901515815260200160405180910390f35b6102a5611325565b604051901515815260200160405180910390f35b6102a5610955565b604051901515815260200160405180910390f35b341561081f57600080fd5b6102a561134b565b604051901515815260200160405180910390f35b341561084657600080fd5b6102a5600160a060020a036004351660243561137b565b604051901515815260200160405180910390f35b341561087c57600080fd5b6102cc600160a060020a036004358116906024351661140b565b60405190815260200160405180910390f35b34156108b357600080fd5b610604611438565b604051600160a060020a03909116815260200160405180910390f35b34156108e257600080fd5b6102a5600160a060020a0360043516611447565b604051901515815260200160405180910390f35b341561091557600080fd5b6102a56004356114c7565b604051901515815260200160405180910390f35b341561093f57600080fd5b6101f6600160a060020a03600435166114f4565b005b6009546000908190819060ff16151561096d57600080fd5b600754341161097b57600080fd5b600854600160a060020a0333166000908152600a60205260408120549193509011156109bd57600160a060020a0333166000908152600a602052604090205491505b30600160a060020a031663903cc58334846000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff851602815260048101929092526024820152604401602060405180830381600087803b1515610a2b57600080fd5b6102c65a03f11515610a3c57600080fd5b50505060405180516006546101009004600160a060020a031660009081526001602052604090205490925082901080159150610a785750600081115b8015610a9d5750600160a060020a033316600090815260016020526040902054818101115b15610b2157600160a060020a0333811660008181526001602052604080822080548601905560068054610100908190048616845292829020805487900390555492939190920416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a360019250610b26565b600080fd5b5b505090565b60408051908101604052600881527f424220546f6b656e000000000000000000000000000000000000000000000000602082015281565b60065460009060ff161515610b8457610b7c838361153c565b90505b610bea565b600160a060020a03331660009081526005602052604090205460ff16151560011415610bbc57610b7c838361153c565b90505b610bea565b60035433600160a060020a0390811691161415610b2157610b7c838361153c565b90505b610bea565b600080fd5b5b5b5b92915050565b60005481565b60035460009033600160a060020a03908116911614610c1757600080fd5b600160a060020a0384161515610c2c57600080fd5b600160a060020a0330163183901015610c4457600080fd5b600160a060020a03841660009081526001602052604090205482901015610c6a57600080fd5b600160a060020a03841660009081526001602052604081205411610c8d57600080fd5b600160a060020a0380851660008181526001602052604080822080548790039055600654610100900490931681528290208054850190559084156108fc0290859051600060405180830381858888f193505050501515610cec57600080fd5b5060015b5b9392505050565b60065460009060ff161515610d1a57610d1284848461156a565b90505b610cf0565b600160a060020a03331660009081526005602052604090205460ff16151560011415610d5357610d1284848461156a565b90505b610cf0565b60035433600160a060020a0390811691161415610b2157610d1284848461156a565b90505b610cf0565b600080fd5b5b5b5b9392505050565b601281565b60075481565b60095460ff1681565b60035460009033600160a060020a03908116911614610dbe57600080fd5b6000821015610dcc57600080fd5b50600160a060020a0382166000908152600a6020526040902081905560015b5b92915050565b60035433600160a060020a03908116911614610e0d57600080fd5b60045460a060020a900460ff161515610e2557600080fd5b6004805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15b5b5b565b600160a060020a033016315b90565b60045460009033600160a060020a03908116911614610ea157600080fd5b50600654600160a060020a03610100909104811660009081526001602052604080822080549083905560045490931682529020819055610edf61159a565b5b5b50565b6006546101009004600160a060020a03166000908152600160205260408120549054035b90565b60065460ff1681565b60045460a060020a900460ff1681565b6008545b90565b60065460009060ff161515610f4c57610b7c838361162a565b90505b610bea565b600160a060020a03331660009081526005602052604090205460ff16151560011415610f8457610b7c838361162a565b90505b610bea565b60035433600160a060020a0390811691161415610b2157610b7c838361162a565b90505b610bea565b600080fd5b5b5b5b92915050565b60035460009033600160a060020a03908116911614610fd957600080fd5b6009805460ff19168315151790555b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600a6020526000908152604090205481565b60035433600160a060020a0390811691161461103a57600080fd5b60045460a060020a900460ff161561105157600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15b5b5b565b60035460009033600160a060020a039081169116146110c457600080fd5b600160a060020a0380831660008181526005602052604090819020805460ff19169055600354909216917fd288ab5da2e1f37cf384a1565a3f905ad289b092fbdd31950dbbfef148c04f88905160405180910390a35060015b5b919050565b6006546101009004600160a060020a031681565b6000670de0b6b3a76400008261114d8583611658565b81151561115657fe5b0491505b5092915050565b60035460009033600160a060020a0390811691161461117f57600080fd5b50600881905560015b5b919050565b60408051908101604052600581527f4242544f4b000000000000000000000000000000000000000000000000000000602082015281565b60056020526000908152604090205460ff1681565b60035460009033600160a060020a039081169116146111f857600080fd5b33600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561123557600080fd5b5060015b5b90565b60065460009060ff16151561125e57610b7c8383611687565b90505b610bea565b600160a060020a03331660009081526005602052604090205460ff1615156001141561129657610b7c8383611687565b90505b610bea565b60035433600160a060020a0390811691161415610b2157610b7c8383611687565b90505b610bea565b600080fd5b5b5b5b92915050565b6006546101009004600160a060020a03166000908152600160205260409020545b90565b60035460009033600160a060020a0390811691161461130f57600080fd5b506006805460ff191660019081179091555b5b90565b60035460009033600160a060020a0390811691161461123557600080fd5b5060015b5b90565b60035460009033600160a060020a0390811691161461136957600080fd5b506006805460ff1916905560015b5b90565b60065460009060ff16151561139c57610b7c83836116b5565b90505b610bea565b600160a060020a03331660009081526005602052604090205460ff161515600114156113d457610b7c83836116b5565b90505b610bea565b60035433600160a060020a0390811691161415610b2157610b7c83836116b5565b90505b610bea565b600080fd5b5b5b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b600454600160a060020a031681565b60035460009033600160a060020a0390811691161461146557600080fd5b600160a060020a0380831660008181526005602052604090819020805460ff19166001179055600354909216917f0c4b48e75a1f7ab0a9a2f786b5d6c1f7789020403bff177fb54d46edb89ccc00905160405180910390a35060015b5b919050565b60035460009033600160a060020a039081169116146114e557600080fd5b50600781905560015b5b919050565b60035433600160a060020a0390811691161461150f57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60045460009060a060020a900460ff161561155657600080fd5b61156083836116e3565b90505b5b92915050565b60045460009060a060020a900460ff161561158457600080fd5b61158f848484611750565b90505b5b9392505050565b60045433600160a060020a039081169116146115b557600080fd5b600454600354600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b5b565b60045460009060a060020a900460ff161561164457600080fd5b611560838361187c565b90505b5b92915050565b6000828202831580611674575082848281151561167157fe5b04145b151561167c57fe5b8091505b5092915050565b60045460009060a060020a900460ff16156116a157600080fd5b6115608383611978565b90505b5b92915050565b60045460009060a060020a900460ff16156116cf57600080fd5b6115608383611a4f565b90505b5b92915050565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600080600160a060020a038416151561176857600080fd5b50600160a060020a038085166000818152600260209081526040808320339095168352938152838220549282526001905291909120546117ae908463ffffffff611af416565b600160a060020a0380871660009081526001602052604080822093909355908616815220546117e3908463ffffffff611b0b16565b600160a060020a03851660009081526001602052604090205561180c818463ffffffff611af416565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156118d957600160a060020a033381166000908152600260209081526040808320938816835292905290812055611910565b6118e9818463ffffffff611af416565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b6000600160a060020a038316151561198f57600080fd5b600160a060020a0333166000908152600160205260409020546119b8908363ffffffff611af416565b600160a060020a0333811660009081526001602052604080822093909355908516815220546119ed908363ffffffff611b0b16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054611a87908363ffffffff611b0b16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060015b92915050565b600082821115611b0057fe5b508082035b92915050565b60008282018381101561167c57fe5b8091505b50929150505600a165627a7a7230582015817c225449fbdc929748989898f407ee2a11762382f26b1149e6a2bc8648440029", + "networks": {}, "schema_version": "0.0.5", - "updated_at": 1507251633156 + "updated_at": 1507917111406 } \ No newline at end of file diff --git a/src/dapp/public/address.json b/src/dapp/public/address.json index 246ef3a..e123467 100644 --- a/src/dapp/public/address.json +++ b/src/dapp/public/address.json @@ -1 +1 @@ -{"PreICO":{"address":"0xf5c8ec7b37641ce533e786308f14301323194099"}} \ No newline at end of file +{"PreICO":{"address":"0xea6d0d8de0c41f84bf075cff0a2b2cff9ce04430"}} \ No newline at end of file diff --git a/src/dapp/public/partials/coin-admin.html b/src/dapp/public/partials/coin-admin.html index 4635426..0fd2b2b 100644 --- a/src/dapp/public/partials/coin-admin.html +++ b/src/dapp/public/partials/coin-admin.html @@ -193,4 +193,27 @@

Whitelist + +
+

Custom Price

+

A custom price can be set for each user. If price is set to 0, then the default price is used.

+
+
+ + +
+
+ + +
+
+

+ Custom Price is {{ customPrice }} ETH/Token +

+ + + +
\ No newline at end of file diff --git a/src/dapp/public/scripts/app.js b/src/dapp/public/scripts/app.js index cac58b5..9f668b5 100644 --- a/src/dapp/public/scripts/app.js +++ b/src/dapp/public/scripts/app.js @@ -173,6 +173,26 @@ app.controller("CoinAdminCtrl", ['$scope', 'web3', 'ico', '$rootScope', function }); }; + $scope.setPriceForCustomer = function (userAddress, price) { + if (!userAddress) { + return alert( "User Address is required."); + } + + if (!price) { + return alert( "price is required."); + } + + + ico.setPriceForCustomer(userAddress, price, function (err, response) { + if (err) { + alert(err); + return; + } + + alert("The transaction has been submitted. Please wait till the next blocks are mined and check if the custom price setting was successful."); + }); + }; + $scope.takeOwnership = function () { console.log("taking ownership"); ico.takeOwnership(function (err) { @@ -282,6 +302,22 @@ app.controller("CoinAdminCtrl", ['$scope', 'web3', 'ico', '$rootScope', function }); }; + $scope.checkPriceForCustomer = function (address) { + + $scope.showPriceCheckResult = false; + $scope.priceCheckAddress = address; + ico.checkPriceForCustomer(address, function (err, response) { + if (err) { + alert(err); + return; + } + + $scope.customPrice = response; + $scope.showPriceCheckResult = true; + $scope.$apply(); + }); + }; + $rootScope.$on("new-block", function (event) { updateDetails(); }); @@ -343,6 +379,14 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc } $scope.currentPrice = price; + + ico.checkPriceForCustomer(web3.eth.accounts[0], function (err, result) { + if (result > 0) { + $scope.currentPrice = result; + $scope.$apply(); + } + }); + $scope.$apply(); }); @@ -361,7 +405,12 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc updateBalance(); }); - updateBalance(); + updateData(); + + function updateData() { + updateBalance(); + // updatePrice(); + } $scope.updatePrice = function(ethAmount) { $scope.tokenAmount = ethAmount / $scope.currentPrice; @@ -380,7 +429,6 @@ app.controller("WalletCtrl", ["$scope", "web3","ico","$rootScope", function ($sc $scope.displayConfirmData = true; $scope.contractAddress = details.contractAddress; $scope.buyTokenData = details.tranData; - console.log(ico.contractAddress); }); } }; @@ -562,6 +610,13 @@ app.config(function ($routeProvider, $locationProvider) { }); } + function setPriceForCustomer(customerAddress, price, next) { + var wei = web3.toWei(price, "ether"); + ico.setPriceForCustomer.sendTransaction(customerAddress, wei, function (err, result) { + next(err, result); + }); + } + function enableWhitelist(next) { ico.enableWhitelist.sendTransaction(next); } @@ -646,6 +701,20 @@ app.config(function ($routeProvider, $locationProvider) { }); } + function checkPriceForCustomer(address, next) { + getICO().then(function (ico) { + ico.customerPrice(address, function (err, result) { + if (err) { + return next(err); + } + + next(null, web3.fromWei(result)); + }); + }, function (err) { + console.error(err); + }); + } + function whitelistEnabled(next) { getICO().then(function (ico) { ico.whitelistEnabled(function (err, result) { @@ -800,6 +869,8 @@ app.config(function ($routeProvider, $locationProvider) { disableWhitelist: disableWhitelist, pauseICO: pauseICO, takeOwnership: takeOwnership, + setPriceForCustomer: setPriceForCustomer, + checkPriceForCustomer: checkPriceForCustomer, unpauseICO: unpauseICO }; }]);