0.1.30 • Published 29 days ago

@credenza-web3/contracts v0.1.30

Weekly downloads
-
License
MIT
Repository
github
Last release
29 days ago

Credenza3 Contracts

Getting the list of contract and types

Check https://unpkg.com/browse/@credenza-web3/contracts/

Using with credenza passport

Fetch artifact

const response = await fetch("https://unpkg.com/@credenza-web3/contracts/artifacts/{contractName}.json")
const data = await response.json()

Get provider from passport

const provider = await passport.getWeb3Provider()

Create contract instance

const contract = new ethers.Contract('0x...', data.abi, provider)

Advanced Sample Hardhat Project

yarn hardhat prepare-package
yarn hardhat accounts
yarn hardhat compile
yarn hardhat clean
yarn hardhat test
yarn hardhat node
yarn hardhat help
REPORT_GAS=true yarn hardhat test
yarn hardhat coverage
yarn hardhat run scripts/deploy.ts
TS_NODE_FILES=true yarn ts-node scripts/deploy.ts
yarn eslint '**/*.{js,ts}'
yarn eslint '**/*.{js,ts}' --fix
yarn prettier '**/*.{json,sol,md}' --check
yarn prettier '**/*.{json,sol,md}' --write
yarn solhint 'contracts/**/*.sol'
yarn solhint 'contracts/**/*.sol' --fix

Etherscan verification

In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Ropsten node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:

hardhat run --network ropsten scripts/deploy.ts

Then, copy the deployment address and paste it in to replace DEPLOYED_CONTRACT_ADDRESS in this command:

npx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS "Hello, Hardhat!"

Performance optimizations

For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable TS_NODE_TRANSPILE_ONLY to 1 in hardhat's environment. For more details see the documentation.

0.1.30

29 days ago

0.1.29

1 month ago

0.1.27

3 months ago

0.1.28

3 months ago

0.1.26

3 months ago

0.1.25

10 months ago

0.1.24

11 months ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.18

1 year ago

0.1.17

2 years ago

0.1.15

2 years ago

0.1.16

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago