Updated Wallet Version ! Now only 500k gas for Wallet creation

This commit is contained in:
Nicolas Gotchac
2016-12-09 16:24:11 +01:00
parent 63137b1548
commit efee55ae84
4 changed files with 29 additions and 13 deletions

View File

@@ -20,8 +20,10 @@ import { validateUint, validateAddress, validateName } from '~/util/validation';
import { ERROR_CODES } from '~/api/transport/error';
import Contract from '~/api/contract';
import Contracts from '~/contracts';
import { wallet as walletAbi } from '~/contracts/abi';
import { wallet as walletCode } from '~/contracts/code';
import { walletLibraryRegKey } from '~/contracts/code/wallet';
import WalletsUtils from '~/util/wallets';
@@ -160,14 +162,23 @@ export default class CreateWalletStore {
const { account, owners, required, daylimit } = this.wallet;
const options = {
data: walletCode,
from: account
};
Contracts
.get()
.registry
.lookupAddress(walletLibraryRegKey)
.then((address) => {
const walletLibraryAddress = address.replace(/^0x/, '').toLowerCase();
const code = walletCode.replace(/(_)+WalletLibrary(_)+/g, walletLibraryAddress);
this.api
.newContract(walletAbi)
.deploy(options, [ owners, required, daylimit ], this.onDeploymentState)
const options = {
data: code,
from: account
};
return this.api
.newContract(walletAbi)
.deploy(options, [ owners, required, daylimit ], this.onDeploymentState);
})
.then((address) => {
this.deployed = true;
this.wallet.address = address;