NAGA ICO Contract
https://docsend.com/view/bfpgmza
Install dependencies:
npm i
First, compile the contract:
npm run compile
To deploy the smart contract on the development network, run:
npm run deploy-dev
To deploy the smart contract on the Ropsten testnet, run:
npm run deploy-ropsten
Be careful! Every deploy on the same network replaces metadata (including the contract address) stored in the build
directory.
To mint tokens, prepare a JSON file distribution.json
. For example:
{
"0x8A6d9138e960577D230Ba5F86f872418EA8c0506": {
"amount": 1.23,
"releaseTime": 1519862400
},
"0xf6d1fa4fd83ba3e0c77642756e95917b8a47c1dd": {
"amount": 0.000000000000000001,
"releaseTime": 0
}
}
Then run (on the development network):
npm run mint-dev distribution.json
Or on the Ropsten testnet:
npm run mint-ropsten distribution.json
On the development network:
npm run finish-dev
On the Ropsten testnet:
npm run finish-ropsten
Run testrpc:
npm run testrpc
While testrpc is running, run tests:
npm test
Due to use of testrpc’s evm_increaseTime
, you should restart testrpc after each run of tests.
geth --testnet --rpc
IPC endpoint opened: /Users/username/Library/Ethereum/testnet/geth.ipc
geth attach /Users/username/Library/Ethereum/testnet/geth.ipc
... Imported new chain segment blocks=1 ...
Also you can run eth.syncing
in the geth console. It should return false
instead of sync information.
personal.newAccount()
When it prompts for a passphrase, input a strong one (32 random chars, for example). Of course, you have to store it somewhere.
geth --testnet --rpc --unlock "0x0000000000000000000000000000000000000000"
Instead of 0x0000000000000000000000000000000000000000
, use account you created in the previous step. While starting, geth will prompt you for the passphrase.