mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 12:05:18 +00:00
6da31bd662
* setup empty hardhat project for evm contract dev * setup eslint * setup prettier * setup solhint * ignore contracts dir in docker * add ERC20KavaWrappedNativeCoin contract * add unit tests for ERC20KavaWrappedNativeCoin * use solidity 0.8.18 * configure solc with optimization and evm target * compile ERC20KavaWrappedNativeCoin for evmutil * setup script for deploying directly to a network * fix burn test for ERC20KavaWrappedNativeCoin Co-authored-by: drklee3 <derrick@dlee.dev> --------- Co-authored-by: drklee3 <derrick@dlee.dev>
46 lines
1.0 KiB
Markdown
46 lines
1.0 KiB
Markdown
# Kava EVM contracts
|
|
|
|
Contracts for the Kava EVM used by the Kava blockchain.
|
|
Includes an ERC20 contract for wrapping native cosmos sdk.Coins.
|
|
|
|
## Setup
|
|
|
|
```
|
|
npm install
|
|
```
|
|
|
|
## Test
|
|
|
|
```
|
|
npm test
|
|
```
|
|
|
|
## Development
|
|
|
|
```
|
|
# Watch contract + tests
|
|
npm run dev
|
|
|
|
# Watch tests only
|
|
npm run test-watch
|
|
```
|
|
|
|
## Deploying contracts to test networks
|
|
|
|
A deploy script is included in this hardhat project to deploy a contract directly to a network.
|
|
To deploy the contracts to different networks:
|
|
```
|
|
npx hardhat run --network <network-name> scripts/deploy.ts
|
|
```
|
|
|
|
Configuration for various `<network-name>`s above are setup in the [hardhat config](./hardhat.config.ts).
|
|
|
|
## Production compiling & Ethermint JSON
|
|
|
|
Ethermint uses its own json format that includes the ABI and bytecode in a single file. The bytecode should have no `0x` prefix and should be under the property name `bin`. This structure is built from the compiled code with `npm ethermint-json`.
|
|
|
|
The following compiles the contract, builds the ethermint json and copies the file to the evmutil:
|
|
```
|
|
npm build
|
|
```
|