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

USDC related changes #151

Merged
merged 76 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
af0407b
chore(connection): updates docstring for `defaultFeeCurrency`
arthurgousset Feb 22, 2024
f64bf9e
refactor(kit): updates `setFeeCurrency`
arthurgousset Feb 22, 2024
13d6c8d
chore(setFeeCurrency): adds hex type and address validation
arthurgousset Feb 22, 2024
319d00d
nit(connect): adds feeCurrency type todo
arthurgousset Feb 22, 2024
78da039
chore(kit): adds error handling in `setFeeCurrency`
arthurgousset Feb 22, 2024
a198b61
nit(contrackit): adds TODO in README code example
arthurgousset Feb 23, 2024
b53649e
chore(kit): adds `throws` docstring in `setFeeCurrency`
arthurgousset Feb 23, 2024
1aeaa5c
nit(contrackit): adds another TODO in README code example
arthurgousset Feb 23, 2024
921f545
nit(cli): adds TODO related to `setFeeCurrency`
arthurgousset Feb 23, 2024
0a72152
nit(connect): adds TODO related to hex address typing
arthurgousset Feb 23, 2024
ffc966d
Merge branch 'master' into arthurgousset/usdc-related-changes
arthurgousset Feb 23, 2024
56f5567
chore(kit): uses `isAddress` instead of `isHexString`
arthurgousset Feb 23, 2024
a1e8387
chore(cli): automatic linting
arthurgousset Feb 23, 2024
fea1ddd
nit(CONTRIBUTING): fixes incorrect hyperlink
arthurgousset Feb 26, 2024
0769487
chore(cli): adds TODOs re fee currencies
arthurgousset Feb 26, 2024
4982a08
chore(cli): adds pseudo-code to fetch fee currency whitelist on-chain
arthurgousset Feb 26, 2024
cc94f0d
chore(contractkit): adds TODO in README
arthurgousset Feb 27, 2024
63bc7be
Merge branch 'master' into arthurgousset/usdc-related-changes
arthurgousset Feb 27, 2024
863a09b
chore(cli): implements `getGasOptions` helper function
arthurgousset Feb 27, 2024
176c5f3
chore(cli): adds TODO notes on `gasOptions`
arthurgousset Feb 27, 2024
7df0b36
Merge branch 'arthurgousset/usdc-related-changes' of github.com:celo-…
arthurgousset Feb 27, 2024
cf91f80
test(cli): adds test for `getGasOptions` helper function
arthurgousset Feb 28, 2024
9550e7d
nit(README): fixes title
arthurgousset Feb 28, 2024
9b36c73
test(helpers): fixes bug that caused test to fail
arthurgousset Feb 28, 2024
76efe63
chore(cli): adds TODO
arthurgousset Feb 29, 2024
2b2c577
chore(helpers): removes `return await`
arthurgousset Feb 29, 2024
87a402c
chore(cli): adds TODOs and updates example
arthurgousset Mar 1, 2024
5766ccd
chore(cli): adds incomplete/WIP changes
arthurgousset Mar 1, 2024
52c9a72
Merge branch 'master' into arthurgousset/usdc-related-changes
arthurgousset Mar 1, 2024
cfd895f
feat: change feeCurrency to be a StrongAddress is most places
nicolasbrugneaux Mar 1, 2024
2413030
chore: regenerate docs
nicolasbrugneaux Mar 1, 2024
05bf19e
chore: upgrade celo abis cr11
nicolasbrugneaux Mar 7, 2024
c03a0b5
fix: only throw if the flag has been passed and the value is undefined
nicolasbrugneaux Mar 7, 2024
561eaf6
fix: celocli tests
nicolasbrugneaux Mar 7, 2024
1cf247a
fix: add feecurency whitelisted currencies
nicolasbrugneaux Mar 7, 2024
1e1022d
test: add wrong feeCurrency test
nicolasbrugneaux Mar 7, 2024
1ed021d
test: add failing tests
nicolasbrugneaux Mar 12, 2024
77b98be
fix: gas estimation when submitting a tx
nicolasbrugneaux Mar 12, 2024
80a4a75
Merge branch 'master' into arthurgousset/usdc-related-changes
nicolasbrugneaux Mar 12, 2024
40dfae1
fix: test
nicolasbrugneaux Mar 13, 2024
1d0b62a
fix: proper gas/value check
nicolasbrugneaux Mar 13, 2024
d48f049
refactor: test displays the faulty value
nicolasbrugneaux Mar 13, 2024
589d93b
chore: regenerate docs
nicolasbrugneaux Mar 13, 2024
331e711
fix: rollback to celo-legacy tx
nicolasbrugneaux Mar 14, 2024
00bd6be
chore: regenerate docs
nicolasbrugneaux Mar 14, 2024
906af79
Merge branch 'master' into arthurgousset/usdc-related-changes
nicolasbrugneaux Mar 14, 2024
b9967b3
fix: revert some unwanted chaanges
nicolasbrugneaux Mar 15, 2024
b98f586
fix: remove CELO from the whitelisted currencies
nicolasbrugneaux Mar 15, 2024
e5e17eb
refactor: Address->StrongAddress
nicolasbrugneaux Mar 15, 2024
c490604
fix: tests failing due to StrongAddress typings
nicolasbrugneaux Mar 15, 2024
dfa325f
feat(BREAKING): change default behaviour of transfer commands
nicolasbrugneaux Mar 15, 2024
f0da7f7
fix: StrongAddress
nicolasbrugneaux Mar 15, 2024
923471c
fix: type
nicolasbrugneaux Mar 15, 2024
c9d4d0a
chore: regenerate docs
nicolasbrugneaux Mar 15, 2024
e08611a
fix: getting gas balance
nicolasbrugneaux Mar 15, 2024
b2cc3b3
fix: ElectionActivate tests
nicolasbrugneaux Mar 18, 2024
baae413
chore: regenerate docs
nicolasbrugneaux Mar 18, 2024
5935782
feat: add FeeCurrencyWhitelist wrapper and refactor kit and cli to us…
nicolasbrugneaux Mar 18, 2024
24185ae
await registerAccount() to pass all checks for "shows no pending vote…
shazarre Mar 18, 2024
5cc58f5
chore: remove pasted comments
nicolasbrugneaux Mar 18, 2024
7e0fd54
chore: regenerate docs
nicolasbrugneaux Mar 18, 2024
9ef1ca9
Merge branch 'prerelease/mcrn' into arthurgousset/usdc-related-changes
nicolasbrugneaux Mar 18, 2024
14d5f97
fix: gasCurrency fallback
nicolasbrugneaux Mar 18, 2024
14dc947
chore: remove comment
nicolasbrugneaux Mar 18, 2024
0625f93
feat: handle adapted token in the whitelist
nicolasbrugneaux Mar 19, 2024
8f5ec62
fix: prevent unecessary network call for every command
nicolasbrugneaux Mar 19, 2024
a4b6d4f
fix: ts-expect-error directive
nicolasbrugneaux Mar 19, 2024
c9f40b3
chore: regenerate docs
nicolasbrugneaux Mar 19, 2024
6c052ee
chore: add changeset
nicolasbrugneaux Mar 19, 2024
869676b
fix: handle feeCurrency capitalization
nicolasbrugneaux Mar 19, 2024
01478f1
fix: handle compatibility issues with config and gasCurrency
nicolasbrugneaux Mar 19, 2024
c25e059
refactor: some PR review feedback addressed
nicolasbrugneaux Mar 20, 2024
b7a3154
fix: handle CELO as a gasCurrency
nicolasbrugneaux Mar 20, 2024
50c0c7b
chore: add one changeset per package changed
nicolasbrugneaux Mar 20, 2024
8ceef09
test: test adapted tokens too
nicolasbrugneaux Mar 20, 2024
d72868a
fix: handle CELO capitalization
nicolasbrugneaux Mar 20, 2024
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 packages/cli/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export abstract class BaseCommand extends Command {
: getGasCurrency(this.config.configDir)

const setStableTokenGas = async (stable: StableToken) => {
// TODO(Arthur): Update implementation to match new `setFeeCurrency` method signature
await kit.setFeeCurrency(stableTokenInfos[stable].contract)
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved
}
if (Object.keys(StableToken).includes(gasCurrencyConfig)) {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/transfer-stable-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export abstract class TransferStableBase extends BaseCommand {
}
// If gasCurrency is not set, use the transferring token
if (!res.flags.gasCurrency) {
// TODO(Arthur): Update implementation to match new `setFeeCurrency` method signature
await kit.setFeeCurrency(stableTokenInfos[this._stableCurrency].contract)
}

Expand Down
1 change: 1 addition & 0 deletions packages/sdk/connect/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class Connection {
*
* @param address ERC20 address
*/
// TODO(Arthur): Consider replacing `Address` with stronger type like `StrongAddress`
set defaultFeeCurrency(address: Address | undefined) {
this.config.feeCurrency = address
}
Expand Down
5 changes: 3 additions & 2 deletions packages/sdk/contractkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ async function getKit(myAddress: string, privateKey: string) {
kit.connection.addAccount(privateKey)

// paid gas in celo dollars
await kit.setFeeCurrency(CeloContract.StableToken)
// TODO(Arthur): Update this example when the method signature for `setFeeCurrency` is confirmed.
await kit.setFeeCurrency(CeloContract.StableToken)

return kit
}
Expand Down Expand Up @@ -117,7 +118,7 @@ const receipt = await tx.waitReceipt()
If you would like to pay fees in cUSD, (or other cStables like cEUR, cUSD).

```ts

// TODO(Arthur): Update this example when the method signature for `setFeeCurrency` is confirmed.
kit.setFeeCurrency(CeloContract.StableToken) // Default to paying fees in cUSD

const stableTokenContract = kit.contracts.getStableToken()
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/contractkit/src/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class ContractKit {
/**
* Set an addressed to use to pay for gas fees
* @param address any hexadecimal address
* @dev Throws if supplied address is not a valid hexadecimal address
*/
setFeeCurrency(address: StrongAddress) {
if (!isHexString(address)) {
Expand Down
Loading