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

update pool func visibility #1283

Merged
merged 8 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
14 changes: 7 additions & 7 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,13 @@ TokenProxy_getFee:test_GetFeeInvalidToken_Revert() (gas: 12658)
TokenProxy_getFee:test_GetFeeNoDataAllowed_Revert() (gas: 15849)
TokenProxy_getFee:test_GetFee_Success() (gas: 86702)
USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 25290)
USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35322)
USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30073)
USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133102)
USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 477183)
USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268111)
USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 50676)
USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 98591)
USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35397)
USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30148)
USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133177)
USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 477258)
USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268172)
USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 50733)
USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 98648)
USDCTokenPool_setDomains:test_InvalidDomain_Revert() (gas: 66150)
USDCTokenPool_setDomains:test_OnlyOwner_Revert() (gas: 11333)
USDCTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 9876)
30 changes: 24 additions & 6 deletions contracts/src/v0.8/ccip/pools/USDC/USDCTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,32 @@ contract USDCTokenPool is TokenPool, ITypeAndVersion {
emit ConfigSet(address(tokenMessenger));
}

/// @notice Burns USDC in the pool
/// @dev invokes underlying CCTP protocol
function lockOrBurn(Pool.LockOrBurnInV1 calldata lockOrBurnIn)
Copy link
Collaborator

Choose a reason for hiding this comment

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

making them public feels a lot cleaner

external
override
returns (Pool.LockOrBurnOutV1 memory lockOrBurnOut)
{
return _lockOrBurn(lockOrBurnIn);
}

/// @notice Mints USDC to the recipient
/// @dev invokes underlying CCTP protocol
function releaseOrMint(Pool.ReleaseOrMintInV1 calldata releaseOrMintIn)
external
override
returns (Pool.ReleaseOrMintOutV1 memory)
{
return _releaseOrMint(releaseOrMintIn);
}

/// @notice Burn the token in the pool
/// @dev emits ITokenMessenger.DepositForBurn
/// @dev Assumes caller has validated destinationReceiver
function lockOrBurn(Pool.LockOrBurnInV1 calldata lockOrBurnIn)
external
function _lockOrBurn(Pool.LockOrBurnInV1 calldata lockOrBurnIn)
internal
virtual
override
returns (Pool.LockOrBurnOutV1 memory)
{
_validateLockOrBurn(lockOrBurnIn);
Expand Down Expand Up @@ -138,10 +157,9 @@ contract USDCTokenPool is TokenPool, ITypeAndVersion {
/// for that message, including its (nonce, sourceDomain). This way, the only
/// non-reverting offchainTokenData that can be supplied is a valid attestation for the
/// specific message that was sent on source.
function releaseOrMint(Pool.ReleaseOrMintInV1 calldata releaseOrMintIn)
external
function _releaseOrMint(Pool.ReleaseOrMintInV1 calldata releaseOrMintIn)
internal
virtual
override
returns (Pool.ReleaseOrMintOutV1 memory)
{
_validateReleaseOrMint(releaseOrMintIn);
Expand Down
Loading
Loading