2.1.0 • Published 4 years ago

@smartwallet/contracts v2.1.0

Weekly downloads
16
License
-
Repository
github
Last release
4 years ago

SmartWallet contracts

NPM version

Installation

$ npm i @smartwallet/contracts -S

Usage

import {
  ContractNames,
  getContractAddress,
  getContractAbi,
  getContractByteCodeHash,
} from '@smartwallet/contracts';

console.log(
  'AccountProviderV2 mainnet address:',
  getContractAddress(ContractNames.AccountProviderV2, '1'),
);
console.log(
  'AccountProviderV2 ropsten address:',
  getContractAddress(ContractNames.AccountProviderV2, '3'),
);
console.log(
  'Account abi:',
  getContractAbi(ContractNames.Account),
);
console.log(
  'Account byteCodeHash:',
  getContractByteCodeHash(ContractNames.Account),
);

Contracts:

NameabibyteCodeHashaddresses
Account
AccountProviderV1
AccountProviderV2
AccountProxyV1
AccountProxyV2
AccountFriendRecovery
ENSRegistry
ENSResolver
ExampleToken
ERC20Token
Guardian
VirtualPaymentManager

Development

Configure env variables:

NameDefault Value
PROVIDER_MNEMONIC-
PROVIDER_ENDPOINThttp://localhost:8545
VIRTUAL_PAYMENT_LOCK_PERIOD30 * 24 * 60 * 60

Start Migration:

npm run migrate-<env>, for example:

$ npm run migrate-local

Building ./dist

$ npm run dist

Running Tests

$ npm test