Updated Wallet Version ! Now only 500k gas for Wallet creation
This commit is contained in:
		
							parent
							
								
									63137b1548
								
							
						
					
					
						commit
						efee55ae84
					
				@ -14,7 +14,7 @@
 | 
				
			|||||||
// You should have received a copy of the GNU General Public License
 | 
					// You should have received a copy of the GNU General Public License
 | 
				
			||||||
// along with Parity.  If not, see <http://www.gnu.org/licenses/>.
 | 
					// along with Parity.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import wallet from './wallet';
 | 
					import { wallet } from './wallet';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export {
 | 
					export {
 | 
				
			||||||
  wallet
 | 
					  wallet
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -17,6 +17,7 @@
 | 
				
			|||||||
import React, { Component, PropTypes } from 'react';
 | 
					import React, { Component, PropTypes } from 'react';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { RadioButtons } from '~/ui';
 | 
					import { RadioButtons } from '~/ui';
 | 
				
			||||||
 | 
					import { walletSourceURL } from '~/contracts/code/wallet';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// import styles from '../createWallet.css';
 | 
					// import styles from '../createWallet.css';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -46,7 +47,9 @@ export default class WalletType extends Component {
 | 
				
			|||||||
        description: (
 | 
					        description: (
 | 
				
			||||||
          <span>
 | 
					          <span>
 | 
				
			||||||
            <span>Create/Deploy a </span>
 | 
					            <span>Create/Deploy a </span>
 | 
				
			||||||
            <a href='https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol' target='_blank'>standard multi-signature </a>
 | 
					            <a href={ walletSourceURL } target='_blank'>
 | 
				
			||||||
 | 
					              standard multi-signature
 | 
				
			||||||
 | 
					            </a>
 | 
				
			||||||
            <span> Wallet</span>
 | 
					            <span> Wallet</span>
 | 
				
			||||||
          </span>
 | 
					          </span>
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
				
			|||||||
@ -20,8 +20,10 @@ import { validateUint, validateAddress, validateName } from '~/util/validation';
 | 
				
			|||||||
import { ERROR_CODES } from '~/api/transport/error';
 | 
					import { ERROR_CODES } from '~/api/transport/error';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Contract from '~/api/contract';
 | 
					import Contract from '~/api/contract';
 | 
				
			||||||
 | 
					import Contracts from '~/contracts';
 | 
				
			||||||
import { wallet as walletAbi } from '~/contracts/abi';
 | 
					import { wallet as walletAbi } from '~/contracts/abi';
 | 
				
			||||||
import { wallet as walletCode } from '~/contracts/code';
 | 
					import { wallet as walletCode } from '~/contracts/code';
 | 
				
			||||||
 | 
					import { walletLibraryRegKey } from '~/contracts/code/wallet';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import WalletsUtils from '~/util/wallets';
 | 
					import WalletsUtils from '~/util/wallets';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -160,14 +162,23 @@ export default class CreateWalletStore {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const { account, owners, required, daylimit } = this.wallet;
 | 
					    const { account, owners, required, daylimit } = this.wallet;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const options = {
 | 
					    Contracts
 | 
				
			||||||
      data: walletCode,
 | 
					      .get()
 | 
				
			||||||
      from: account
 | 
					      .registry
 | 
				
			||||||
    };
 | 
					      .lookupAddress(walletLibraryRegKey)
 | 
				
			||||||
 | 
					      .then((address) => {
 | 
				
			||||||
 | 
					        const walletLibraryAddress = address.replace(/^0x/, '').toLowerCase();
 | 
				
			||||||
 | 
					        const code = walletCode.replace(/(_)+WalletLibrary(_)+/g, walletLibraryAddress);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.api
 | 
					        const options = {
 | 
				
			||||||
      .newContract(walletAbi)
 | 
					          data: code,
 | 
				
			||||||
      .deploy(options, [ owners, required, daylimit ], this.onDeploymentState)
 | 
					          from: account
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return this.api
 | 
				
			||||||
 | 
					          .newContract(walletAbi)
 | 
				
			||||||
 | 
					          .deploy(options, [ owners, required, daylimit ], this.onDeploymentState);
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
      .then((address) => {
 | 
					      .then((address) => {
 | 
				
			||||||
        this.deployed = true;
 | 
					        this.deployed = true;
 | 
				
			||||||
        this.wallet.address = address;
 | 
					        this.wallet.address = address;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user