-
Notifications
You must be signed in to change notification settings - Fork 825
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
EVM ERC20 Template Contract #1146
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## evm #1146 +/- ##
==========================================
+ Coverage 65.49% 65.53% +0.03%
==========================================
Files 328 328
Lines 21001 21001
==========================================
+ Hits 13754 13762 +8
+ Misses 6540 6533 -7
+ Partials 707 706 -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good. We can test it on a local sei before merging:
- create a tokenfactory denom:
seid tx tokenfactory create-denom test
- mint some tokens for an account:
seid tx tokenfactory mint
- instantiate an ERC-20 contract for the denom
- send tokens from the minted account to another account via ERC-20
- verify the receiver received the tokens
contracts/src/Counter.sol
Outdated
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
contract Counter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this counter contract?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, removed.
IBank public BankPrecompile; | ||
|
||
constructor(string memory denom_) ERC20("", "") { | ||
BankPrecompile = IBank(BANK_PRECOMPILE_ADDRESS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious: how much space would it take to store BankPrecompile
as a state? Is it just an address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it should just be an address.
import {IBank} from "./precompiles/IBank.sol"; | ||
import {console2} from "forge-std/Test.sol"; | ||
|
||
contract NativeSeiTokensERC20 is ERC20 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is ERC20
gives us the sending and approval functionalities i suppose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is the syntax to do inheritance.
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
* chore: forge init * forge install: forge-std v1.7.2 * moved foundry.toml and github workflows to top level * forge install: openzeppelin-contracts v5.0.0 * added impl + tests for native sei tokens as erc20s * fix * fix * remove Counter boilerplate code * minor fix
Describe your changes and provide context
Created ERC20 Template contract to allow native sei tokens to be used as ERC20s
Testing performed to validate your change
foundry unit tests + manual testing.