This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", | |
port: 8545, | |
network_id: "*" // match any network | |
}, | |
live: { | |
host: "88.88.88.88", // Random IP for example purposes (do not use) | |
port: 80, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BNK48CoinCrowdSale = artifacts.require("BNK48CoinCrowdSale"); | |
const BNK48Coin = artifacts.require("BNK48Coin"); | |
const RefundVault = artifacts.require("RefundVault"); | |
function ether(n) { | |
return new web3.BigNumber(web3.toWei(n, 'ether')); | |
} | |
module.exports = function (deployer, network, accounts) { | |
const startTime = new web3.BigNumber(Math.floor(new Date().getTime() / 1000)); // Now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
// File: zeppelin-solidity/contracts/math/SafeMath.sol | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
// File: zeppelin-solidity/contracts/math/SafeMath.sol | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
// File: zeppelin-solidity/contracts/math/SafeMath.sol | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
// File: zeppelin-solidity/contracts/math/SafeMath.sol | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; | |
import "zeppelin-solidity/contracts/math/SafeMath.sol"; | |
import "zeppelin-solidity/contracts/ownership/Ownable.sol"; | |
contract Subscription is Ownable { | |
using SafeMath for uint256; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3'); | |
const abi = require('./abi.json'); // ABI of Subscription.sol in "build" directory on truffle project. | |
// noinspection JSUnresolvedVariable | |
const web3 = new Web3( | |
new Web3.providers.WebsocketProvider(config.contract.provider), | |
); | |
const subscriptionContract = new web3.eth.Contract( | |
abi, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
func randomWithWeight(weights []int) int { | |
var sum int | |
for _, v := range weights { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set timeout 20 | |
for {set x 1} {$x<=20} {incr x} { | |
spawn tbnbcli keys add [format "wallet_%02d" $x] | |
expect "Enter a passphrase for your key:" | |
send "password\r"; | |
expect "Repeat the passphrase:" | |
send "password\r"; | |
interact | |
} |