Skip to content

Commit

Permalink
imp(contracts): Add contracts directory and compilation script (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann authored Aug 6, 2024
1 parent 71d1b9b commit ab675cc
Show file tree
Hide file tree
Showing 15 changed files with 5,076 additions and 0 deletions.
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

0 comments on commit ab675cc

Please sign in to comment.