Package Exports
- @etherspot/contracts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@etherspot/contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ETHERspot contracts
Installation
$ npm i @etherspot/contracts -SUsage
Javascript
import {
ContractNames,
TYPED_DATA_DOMAIN_SALT,
getContractAbi,
getContractAddress,
getContractByteCodeHash,
} from '@etherspot/contracts';
console.log(
'PersonalAccountRegistry mainnet address:',
getContractAddress(ContractNames.PersonalAccountRegistry),
);
console.log(
'PersonalAccountRegistry görli address:',
getContractAddress(ContractNames.PersonalAccountRegistry, '5'),
);
console.log(
'ERC20Token abi:',
getContractAbi(ContractNames.ERC20Token),
);
console.log(
'Account byte code hash:',
getContractByteCodeHash(ContractNames.Account),
);
// see: https://eips.ethereum.org/EIPS/eip-712
console.log(
'Typed data domain salt (used in all contracts):',
TYPED_DATA_DOMAIN_SALT,
);
console.log(
'SignatureValidator typed data domain name:',
getContractTypedDataDomainName(ContractNames.PaymentRegistry),
);Development
Configuration
via env variables:
| name | default value | note |
|---|---|---|
PROVIDER_ENDPOINT |
http://localhost:8545 |
|
PROVIDER_MNEMONIC |
(empty) |
|
PROVIDER_PRIVATE_KEY |
0x5504956d5... |
uses first private key from local infra by default |
LOG_GAS_USAGE |
(empty) |
log gas usage in tests |
Scripts
$ npm run test # run tests
$ npm run migrate # migrate contracts
$ npm run build # build dist files
$ npm run initialize # initialize contractsLicense
MIT