Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp(contracts): Add contracts directory and compilation script #24

Merged
merged 27 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This changelog was created using the `clu` binary

### Improvements

- (contracts) [#24](https://github.com/evmos/os/pull/24) Add contracts directory and compilation script.
- (cli) [#23](https://github.com/evmos/os/pull/23) Add client, cmd and version packages.
- (server) [#22](https://github.com/evmos/os/pull/22) Add server implementation.
- (rpc) [#21](https://github.com/evmos/os/pull/21) Add RPC and indexer types.
Expand Down
8 changes: 8 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Compiled contracts
artifacts/

# Cached files
cache/

# Node modules
node_modules/
30 changes: 30 additions & 0 deletions contracts/erc20.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package contracts

import (
_ "embed"

evmtypes "github.com/evmos/evmos/v19/x/evm/types"
contractutils "github.com/evmos/os/contracts/utils"
)

var (
// ERC20MinterBurnerDecimalsJSON are the compiled bytes of the ERC20MinterBurnerDecimalsContract
//
//go:embed solidity/ERC20MinterBurnerDecimals.json
ERC20MinterBurnerDecimalsJSON []byte

// ERC20MinterBurnerDecimalsContract is the compiled erc20 contract
ERC20MinterBurnerDecimalsContract evmtypes.CompiledContract
)

func init() {
var err error
if ERC20MinterBurnerDecimalsContract, err = contractutils.ConvertHardhatBytesToCompiledContract(
ERC20MinterBurnerDecimalsJSON,
); err != nil {
panic(err)
}
}
7 changes: 7 additions & 0 deletions contracts/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: '0.8.19',
paths: {
sources: './solidity'
}
}
Loading
Loading