-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of 'Flow Cancel' modifications to Governor calculations (
#3798) Flow Cancel A 'flow cancel' transfer occurs when all of the following are true: An emitter chain is governed by the Governor A transfer has a TargetChain equal to the emitter A transfer's Timestamp is within the usual 24 hour window used by the Governor The asset in the transfer has fields OriginChain and OriginAddress equal to an entry in the allow list Example scenario A particular USDC implementation minted on Ethereum. It is allow-listed. A transfer of $1,000 of this asset is sent from Solana to Sui. Before the transfer, Sui's usage is $10,000. Before the transfer, Solana's usage is $0. After the transfer is processed, Sui's new usage will be $9,000 (flow cancel) and Solana's new usage will be $1,000 (as usual).
- Loading branch information
1 parent
d1c8f53
commit 34ee3de
Showing
8 changed files
with
776 additions
and
101 deletions.
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
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,24 @@ | ||
package governor | ||
|
||
// FlowCancelTokenList returns a list of `tokenConfigEntry`s representing tokens that can 'Flow Cancel'. This means that incoming transfers | ||
// that use these tokens can reduce the 'daily usage' of the Governor configured for the destination chain. | ||
// The list of tokens was generated by grepping the file `generated_mainnet_tokens.go` for "USDC", "USDT", and "DAI". | ||
// | ||
// Only tokens that are configured in the mainnet token list should be able to flow cancel. That is, if a token is | ||
// present in this list but not in the mainnet token lists, it should not flow cancel. | ||
// | ||
// Note that the field `symbol` is unused. It is retained in this file only for convenience. | ||
func FlowCancelTokenList() []tokenConfigEntry { | ||
return []tokenConfigEntry{ | ||
// USDC variants | ||
{chain: 2, addr: "000000000000000000000000bcca60bb61934080951369a648fb03df4f96263c", symbol: "aUSDC"}, | ||
|
||
// USDT variants | ||
{chain: 1, addr: "b7db4e83eb727f1187bd7a50303f5b4e4e943503da8571ad6564a51131504792", symbol: ""}, | ||
{chain: 1, addr: "ce010e60afedb22717bd63192f54145a3f965a33bb82d2c7029eb2ce1e208264", symbol: "USDT"}, | ||
{chain: 2, addr: "000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7", symbol: "USDT"}, | ||
|
||
// DAI variants | ||
{chain: 2, addr: "0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f", symbol: "DAI"}, | ||
} | ||
} |
Oops, something went wrong.