Skip to content
Permalink
Browse files

configure gas modal also prompted for deploying new multisig instance…

…, directly or through factory contract
  • Loading branch information...
denisgranha committed Jan 24, 2018
1 parent d4ed99f commit fbc9b9d9db392ea19a0414b0e4edf28f5d59e2b3
Showing with 30 additions and 22 deletions.
  1. +30 −22 dapp/services/Wallet.js
@@ -527,32 +527,40 @@

wallet.deployWithLimit = function (owners, requiredConfirmations, limit, cb) {
var MyContract = Web3Service.web3.eth.contract(wallet.json.multiSigDailyLimit.abi);

MyContract.new(
owners,
requiredConfirmations,
limit,
wallet.txDefaults({
data: wallet.json.multiSigDailyLimit.binHex,
gas: (2556980 + 42733 * owners.length) // Gas to create multisig with dynamic gas for owners
}),
cb
);
var gasNeeded = 2556980 + 42733 * owners.length; // Gas to create multisig with dynamic gas for owners

Web3Service.configureGas({gas: gasNeeded, gasPrice: wallet.txParams.gasPrice}, function (gasOptions){
MyContract.new(
owners,
requiredConfirmations,
limit,
wallet.txDefaults({
data: wallet.json.multiSigDailyLimit.binHex,
gas: gasOptions.gas,
gasPrice: gasOptions.gasPrice
}),
cb
);
});
};

wallet.deployWithLimitFactory = function (owners, requiredConfirmations, limit, cb) {
var walletFactory = Web3Service.web3.eth.contract(wallet.json.multiSigDailyLimitFactory.abi).at(txDefault.walletFactoryAddress);

walletFactory.create(
owners,
requiredConfirmations,
limit,
wallet.txDefaults({
data: wallet.json.multiSigDailyLimit.binHex,
gas: (2002000 + 27820 * owners.length)
}),
cb
);
var gasNeeded = 2002000 + 27820 * owners.length;

Web3Service.configureGas({gas: gasNeeded, gasPrice: wallet.txParams.gasPrice}, function (gasOptions){
walletFactory.create(
owners,
requiredConfirmations,
limit,
wallet.txDefaults({
data: wallet.json.multiSigDailyLimit.binHex,
gas: gasOptions.gas,
gasPrice: gasOptions.gasPrice
}),
cb
);
});
};

wallet.deployWithLimitFactoryOffline = function (owners, requiredConfirmations, limit, cb) {

0 comments on commit fbc9b9d

Please sign in to comment.
You can’t perform that action at this time.