@smartwallet/contracts
v2.1.0
Published
SmartWallet contracts
Downloads
12
Readme
SmartWallet contracts
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:
| Name | abi
| byteCodeHash
| addresses
|
| --- | :---: | :---: | :---: |
| Account
| ✅ | ✅ | |
| AccountProviderV1
| ✅ | | ✅ |
| AccountProviderV2
| ✅ | | ✅ |
| AccountProxyV1
| ✅ | | ✅ |
| AccountProxyV2
| ✅ | | ✅ |
| AccountFriendRecovery
| ✅ | | ✅ |
| ENSRegistry
| ✅ | | ✅ |
| ENSResolver
| ✅ | | |
| ExampleToken
| | | ✅ |
| ERC20Token
| ✅ | | |
| Guardian
| | | ✅ |
| VirtualPaymentManager
| ✅ | | ✅ |
Development
Configure env
variables:
| Name | Default Value |
| --- | ---|
| PROVIDER_MNEMONIC | -
|
| PROVIDER_ENDPOINT | http://localhost:8545
|
| VIRTUAL_PAYMENT_LOCK_PERIOD | 30 * 24 * 60 * 60
|
Start Migration:
npm run migrate-<env>
, for example:
$ npm run migrate-local
Building ./dist
$ npm run dist
Running Tests
$ npm test