-
Notifications
You must be signed in to change notification settings - Fork 16
TokenPool V2 Billing #1268
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
base: develop
Are you sure you want to change the base?
TokenPool V2 Billing #1268
Conversation
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol # chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt # chains/evm/scripts/compile_all
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol # chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt # chains/evm/scripts/compile_all
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/pools/TokenPool.sol # chains/evm/gobindings/generated/latest/burn_from_mint_token_pool/burn_from_mint_token_pool.go # chains/evm/gobindings/generated/latest/burn_mint_token_pool/burn_mint_token_pool.go # chains/evm/gobindings/generated/latest/burn_mint_with_lock_release_flag_token_pool/burn_mint_with_lock_release_flag_token_pool.go # chains/evm/gobindings/generated/latest/burn_to_address_mint_token_pool/burn_to_address_mint_token_pool.go # chains/evm/gobindings/generated/latest/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go # chains/evm/gobindings/generated/latest/lock_release_token_pool/lock_release_token_pool.go # chains/evm/gobindings/generated/latest/mock_lbtc_token_pool/mock_lbtc_token_pool.go # chains/evm/gobindings/generated/latest/siloed_lock_release_token_pool/siloed_lock_release_token_pool.go # chains/evm/gobindings/generated/latest/siloed_usdc_token_pool/siloed_usdc_token_pool.go # chains/evm/gobindings/generated/latest/token_pool/token_pool.go # chains/evm/gobindings/generated/latest/usdc_token_pool/usdc_token_pool.go # chains/evm/gobindings/generated/latest/usdc_token_pool_cctp_v2/usdc_token_pool_cctp_v2.go # chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/pools/TokenPool.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.setFastTransferRateLimitConfig.t.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.validateReleaseOrMint.t.sol # chains/evm/gobindings/generated/latest/burn_from_mint_token_pool/burn_from_mint_token_pool.go # chains/evm/gobindings/generated/latest/usdc_token_pool/usdc_token_pool.go # chains/evm/gobindings/generated/latest/usdc_token_pool_cctp_v2/usdc_token_pool_cctp_v2.go
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/gobindings/generated/latest/usdc_token_pool/usdc_token_pool.go # chains/evm/gobindings/generated/latest/usdc_token_pool_cctp_v2/usdc_token_pool_cctp_v2.go # chains/evm/gobindings/generation/generated-wrapper-dependency-versions-do-not-edit.txt
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/pools/TokenPool.sol # chains/evm/contracts/test/helpers/TokenPoolV2Helper.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.applyFee.t.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.applyFinalityConfigUpdates.t.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.validateLockOrBurn.t.sol # chains/evm/contracts/test/pools/TokenPool/TokenPool.validateReleaseOrMint.t.sol
6c28681
to
2cb4a0d
Compare
base will change to develop when rename and lockOrBurn split PRs are merged |
|
event InboundRateLimitConsumed(uint64 indexed remoteChainSelector, address token, uint256 amount); | ||
event CCVConfigUpdated(uint64 indexed remoteChainSelector, address[] outboundCCVs, address[] inboundCCVs); | ||
event FinalityConfigUpdated(uint16 finalityConfig, uint16 customFinalityTransferFeeBps); | ||
event FinalityThresholdUpdated(uint16 finalityConfig); |
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.
event FinalityThresholdUpdated(uint16 finalityConfig); | |
event FinalityThresholdUpdated(uint16 finalityThreshold); |
Also, useful to emit the previous one?
// | 0 means the default finality. | ||
uint16 customFinalityTransferFeeBps; // ─╯ Fee in basis points for custom finality transfers [0-10_000]. | ||
// 0 means the default finality. | ||
uint16 finalityThreshold; // Minimum block depth on the source chain that token issuers consider sufficiently secure |
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.
Haven't seen this comment pattern before, should we just keep everything in-line?
uint16 finalityThreshold; // Minimum block depth on the source chain that token issuers consider sufficiently secure | |
uint16 finalityThreshold; // Minimum block depth on the source chain that token issuers consider sufficiently secure (0 means default finality) |
destAmount -= (lockOrBurnIn.amount * s_finalityConfig.customFinalityTransferFeeBps) / BPS_DIVIDER; | ||
} | ||
// TODO : default finality transfer fee | ||
uint256 feeBps = finality != WAIT_FOR_FINALITY |
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.
WAIT_FOR_FINALITY terminology doesn't seem correct given that we changed the name to "custom finality". Because even using a custom finality, you are still waiting for a measure of finality, just a custom one instead of the default. Would DEFAULT_FINALITY work better? We use the term "default finality" in comments already, so it is clear to understand what this is referring to.
uint256 feeBps = finality != WAIT_FOR_FINALITY | |
uint256 feeBps = finality != DEFAULT_FINALITY |
EnumerableSet.Bytes32Set remotePools; // Set of remote pool hashes, ABI encoded in the case of a remote EVM chain. | ||
} | ||
|
||
struct CustomFinalityConfig { |
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.
We could just have finalityThreshold as a storage variable now.
No description provided.