-
Notifications
You must be signed in to change notification settings - Fork 11
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
WIP: USDC support as first-class citizen #130
Closed
Closed
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { StableToken } from '@celo/contractkit' | ||
import ExchangeStableBase from '../../exchange-stable-base' | ||
import { CustomFlags } from '../../utils/command' | ||
export default class ExchangeReals extends ExchangeStableBase { | ||
static description = 'Exchange Circle USD Coin ($USDC) for CELO via the stability mechanism' | ||
|
||
static flags = { | ||
...ExchangeStableBase.flags, | ||
from: CustomFlags.address({ | ||
required: true, | ||
description: 'The address with Circle USD Coin ($USDC) to exchange', | ||
}), | ||
value: CustomFlags.wei({ | ||
required: true, | ||
description: 'The value of Circle USD Coin ($USDC) to exchange for CELO', | ||
}), | ||
} | ||
|
||
static examples = [ | ||
'reals --value 10000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d', | ||
'reals --value 10000000000000 --forAtLeast 50000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d', | ||
] | ||
|
||
async init() { | ||
this._stableCurrency = StableToken.$USDC | ||
await super.init() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { StableToken } from '@celo/contractkit' | ||
import { TransferStableBase } from '../../transfer-stable-base' | ||
|
||
export default class TransferUSDCoin extends TransferStableBase { | ||
static description = 'Transfer Circle USD Coin ($USDC) to a specified address.' | ||
|
||
static flags = { | ||
...TransferStableBase.flags, | ||
} | ||
|
||
static examples = [ | ||
'$usdc --from 0xa0Af2E71cECc248f4a7fD606F203467B500Dd53B --to 0x5409ed021d9299bf6814279a6a1411a7e866a631 --value 1000000000000000000', | ||
] | ||
|
||
async init() { | ||
this._stableCurrency = StableToken.$USDC | ||
await super.init() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
|
||
# @celo/base | ||
|
||
This package contains shared classes and functions used by other celo packages. It was designed to have minimal external dependencies. (for shared celo functions that have big external dependencies see the @celo/utils, @celo/cryptographic-utils, @celo/phone-utils, @celo/network-utils packages) | ||
|
||
|
||
## Notable Types | ||
|
||
```typescript | ||
// enums StableTokens and Token are enums, CeloTokenType is the type that must be one of the 2 enums | ||
import { StableTokens, Token, CeloTokenType } from "@celo/base" | ||
import { StableTokens, Token, CeloTokenType } from '@celo/base' | ||
|
||
StableTokens.cUSD | ||
|
||
StableTokens.cEUR | ||
|
||
StableTokens.cREAL | ||
|
||
StableTokens.$USDC | ||
|
||
Token.CELO | ||
``` | ||
|
||
## Notable Functions | ||
|
||
```typescript | ||
import { eqAddress, normalizeAddress, isNullAddress } from "@celo/base" | ||
import { eqAddress, normalizeAddress, isNullAddress } from '@celo/base' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If I'm not mistaken, this is not going to work for
StableToken$USDC
, because USDC will not be a core contract, so won't be inRegistry.sol
.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.
righto