-
Notifications
You must be signed in to change notification settings - Fork 7
/
BCAPTokenDeploy.js
17 lines (16 loc) · 6.32 KB
/
BCAPTokenDeploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
* Deployment script for Blockchain Capital Token Smart Contract.
* Copyright © 2017 by ABDK Consulting.
*/
if (!web3.eth.contract ([{"constant":false,"inputs":[],"name":"freezeTransfers","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"unfreezeTransfers","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_tokenIssuer","type":"address"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[],"name":"Freeze","type":"event"},{"anonymous":false,"inputs":[],"name":"Unfreeze","type":"event"},{"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"},{"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"}]).new (
tokenIssuer,
{from: web3.eth.accounts[0], data: "0x60606040526003805460a060020a60ff0219169055341561001c57fe5b6040516020806107c483398101604052515b805b5b5b60028054600160a060020a031916600160a060020a038316908117909155600090815260208190526040902060001990555b5060038054600160a060020a031916600160a060020a0383161790555b505b610732806100926000396000f300606060405236156100725763ffffffff60e060020a600035041663015024608114610074578063095ea7b31461008657806318160ddd146100b957806323b872dd146100db57806331c420d41461011457806370a0823114610126578063a9059cbb14610154578063dd62ed3e14610187575bfe5b341561007c57fe5b6100846101bb565b005b341561008e57fe5b6100a5600160a060020a036004351660243561023b565b604080519115158252519081900360200190f35b34156100c157fe5b6100c96102a6565b60408051918252519081900360200190f35b34156100e357fe5b6100a5600160a060020a03600435811690602435166044356102d4565b604080519115158252519081900360200190f35b341561011c57fe5b610084610307565b005b341561012e57fe5b6100c9600160a060020a0360043516610380565b60408051918252519081900360200190f35b341561015c57fe5b6100a5600160a060020a03600435166024356103b1565b604080519115158252519081900360200190f35b341561018f57fe5b6100c9600160a060020a03600435811690602435166103e6565b60408051918252519081900360200190f35b60035433600160a060020a039081169116146101d75760006000fd5b60035460a060020a900460ff161515610238576003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b5b565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600254600160a060020a03166000908152602081905260408120546102ce9060001990610413565b90505b90565b60035460009060a060020a900460ff16156102f1575060006102ff565b6102fc84848461042e565b90505b5b9392505050565b60035433600160a060020a039081169116146103235760006000fd5b60035460a060020a900460ff1615610238576003805474ff0000000000000000000000000000000000000000191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a15b5b565b600254600090600160a060020a038381169116146103a6576103a1826105c5565b6103a9565b60005b90505b919050565b60035460009060a060020a900460ff16156103ce575060006102a0565b6103d883836105e4565b90506102a0565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000818310156104235760006000fd5b508082035b92915050565b600160a060020a0380841660009081526001602090815260408083203390941683529290529081205482901015610467575060006102ff565b600160a060020a03841660009081526020819052604090205482901015610490575060006102ff565b600160a060020a03808516600090815260016020908152604080832033909416835292905220546104c19083610413565b600160a060020a038086166000908152600160209081526040808320339094168352929052908120919091558211801561050d575082600160a060020a031684600160a060020a031614155b156105ba57600160a060020a0384166000908152602081905260409020546105359083610413565b600160a060020a03808616600090815260208190526040808220939093559085168152205461056490836106e7565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b5060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a0333166000908152602081905260408120548290101561060d575060006102a0565b60008211801561062f575082600160a060020a031633600160a060020a031614155b156106dd57600160a060020a0333166000908152602081905260409020546106579083610413565b600160a060020a03338116600090815260208190526040808220939093559085168152205461068690836106e7565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b5060015b92915050565b600081600019038311156106fb5760006000fd5b508181015b929150505600a165627a7a723058205e64ce47ca67e1c613a62eff9d1f0be90ee852f0ad9fa29c4ca14e102bb4215d0029", gas: 1000000},
function (e, r) {
if (e) throw e;
if (typeof r.address !== "undefined") {
console.log (
"Deployed at " + r.address + " (tx: " + r.transactionHash + ")");
}
}).transactionHash) {
console.log ("Deployment failed. Probably web3.eth.accounts[0] is locked.");
}