-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
218 additions
and
254 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
var Migrations = artifacts.require("./Migrations.sol"); | ||
const Migrations = artifacts.require('./Migrations.sol'); | ||
|
||
module.exports = function(deployer) { | ||
deployer.deploy(Migrations); | ||
}; | ||
module.exports = deployer => deployer.deploy(Migrations); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
const SalableDeployer = require('./deployers/Salable'); | ||
|
||
const Salable = artifacts.require('Salable'); | ||
|
||
module.exports = (deployer, network, accounts) => SalableDeployer(deployer, network, accounts, Salable); | ||
module.exports = (deployer, network, accounts) => SalableDeployer( | ||
deployer, network, accounts, Salable, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,55 @@ | ||
const getConfig = require('../inc/getConfig'); | ||
const abi = require('ethereumjs-abi'); | ||
const getConfig = require('../inc/getConfig'); | ||
|
||
module.exports = (deployer, network, accounts, SalableArtifact) => { | ||
return deployer.then(async () => { | ||
const { config, wallet } = getConfig(network, accounts); | ||
|
||
// assert.ok(wallet); | ||
|
||
var args = [ | ||
wallet, | ||
config['total'], | ||
config['name'], | ||
config['decimals'], | ||
config['symbol'], | ||
config['price'], | ||
config['startBlock'], | ||
config['freezeBlock'], | ||
config['cap'], | ||
config['locked'] | ||
]; | ||
|
||
console.log('args: ' + args.join(',')); | ||
|
||
var encoded = abi.rawEncode( | ||
[ | ||
'address', | ||
'uint256', | ||
'string', | ||
'uint8', | ||
'string', | ||
'uint256', | ||
'uint256', | ||
'uint256', | ||
'uint256', | ||
'uint256' | ||
], | ||
args | ||
); | ||
|
||
console.log('encoded argument for Salable contract: ' + encoded.toString('hex')); | ||
|
||
return deployer.deploy( | ||
SalableArtifact, | ||
wallet, | ||
config['total'], | ||
config['name'], | ||
config['decimals'], | ||
config['symbol'], | ||
config['price'], | ||
config['startBlock'], | ||
config['freezeBlock'], | ||
config['cap'], | ||
config['locked'] | ||
); | ||
}); | ||
}; | ||
|
||
module.exports = (deployer, network, accounts, SalableArtifact) => deployer.then(async () => { | ||
const { config, wallet } = getConfig(network, accounts); | ||
|
||
// assert.ok(wallet); | ||
|
||
const args = [ | ||
wallet, | ||
config.total, | ||
config.name, | ||
config.decimals, | ||
config.symbol, | ||
config.price, | ||
config.startBlock, | ||
config.freezeBlock, | ||
config.cap, | ||
config.locked, | ||
]; | ||
|
||
console.log(`args: ${args.join(',')}`); | ||
|
||
const encoded = abi.rawEncode( | ||
[ | ||
'address', | ||
'uint256', | ||
'string', | ||
'uint8', | ||
'string', | ||
'uint256', | ||
'uint256', | ||
'uint256', | ||
'uint256', | ||
'uint256', | ||
], | ||
args, | ||
); | ||
|
||
console.log(`encoded argument for Salable contract: ${encoded.toString('hex')}`); | ||
|
||
return deployer.deploy( | ||
SalableArtifact, | ||
wallet, | ||
config.total, | ||
config.name, | ||
config.decimals, | ||
config.symbol, | ||
config.price, | ||
config.startBlock, | ||
config.freezeBlock, | ||
config.cap, | ||
config.locked, | ||
); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,9 @@ | |
"version": "0.1.0", | ||
"description": "Typical Ethereum based Sale Contracts", | ||
"scripts": { | ||
"lint:solium": "solium --dir . --fix", | ||
"lint:js": "./node_modules/.bin/eslint ./test --no-ignore --ext .js --fix", | ||
"lint:js-migrations": "./node_modules/.bin/eslint ./migrations --no-ignore --ext .js --fix", | ||
"lint": "npm run lint:js && npm run lint:js-migrations && npm run lint:solium", | ||
"lint": "npm run lint:js && npm run lint:js-migrations", | ||
"test": "scripts/test.sh" | ||
}, | ||
"author": "Miguel Morales <[email protected]>", | ||
|
@@ -18,6 +17,7 @@ | |
"dependencies": { | ||
"bip39": "2.5.0", | ||
"bn.js": "4.11.8", | ||
"bignumber.js": "8.1.1", | ||
"ethereumjs-abi": "0.6.6", | ||
"ethjs-provider-http": "0.1.6", | ||
"ethjs-query": "0.3.8", | ||
|
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
Oops, something went wrong.