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

[cli] transfer:erc20 and balance commands #7753

Merged
merged 5 commits into from
Apr 26, 2021

Conversation

gastonponti
Copy link
Contributor

Description

Command to transfer and check balance of erc20 contracts

Tested

Manually in alfajores

Backwards compatibility

Yes

@gastonponti gastonponti requested a review from a team April 25, 2021 16:02
@gastonponti gastonponti requested a review from a team as a code owner April 25, 2021 16:02
packages/cli/src/commands/account/balance.ts Outdated Show resolved Hide resolved

static flags = {
...BaseCommand.flags,
erc20Address: Flags.address({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can define this flag once and reuse it across the commands

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if we require this in more that these two commands. We could leave it this way and if we see another pattern, we could extract it in the future

@@ -6,6 +6,7 @@ export enum CeloContract {
DowntimeSlasher = 'DowntimeSlasher',
Election = 'Election',
EpochRewards = 'EpochRewards',
ERC20 = 'ERC20',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like the wrong place for this to live

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "ERC20" a CeloContract?

Copy link
Contributor Author

@gastonponti gastonponti Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should define what we think it is a CeloContract. In a way, we think of those as the contracts supported/maintained by celo. The ERC20 is a standard accepted by everyone.
Let's say that the contract does not exist in the ethereum network, we would probably want to handle and support that contract.
So, in a way, it is something standard for celo too, we are just taking the advantage of reuse it from other network.

If we think of the CeloContracts as only the ones that live on the registry, we should also remove the multisig from that list, for example.

If we think of the CeloContracts, as the one accepted by the community, all the ercXXX accepted, should be supported too

gastonponti and others added 2 commits April 25, 2021 19:10
Co-authored-by: Yorke Rhodes <yorhodes@cLabs.co>
@gastonponti gastonponti merged commit 372ffee into master Apr 26, 2021
@gastonponti gastonponti deleted the gastonponti/cli-erc20-transfer-balance branch April 26, 2021 11:37
mergify bot pushed a commit that referenced this pull request Jul 6, 2021
### Description

`RegisteredContracts` list used in ContractKit for comprehensive registry lookup and governance proposal decoding (among others) errantly includes `CeloContract.ERC20` introduced in #7753 despite this not being a registered contract. This PR adds `CeloContract.ERC20` to `AuxiliaryContracts` to be filtered out.

### Tested

Before change, `Error: ERC20 not yet deployed for this chain` is emitted on many CLI changes. After change, error is no longer observed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants