Skip to content

Commit

Permalink
test: handlers for remaining superc20 state transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Aug 20, 2024
1 parent 9d4b8d3 commit 49fa9e2
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,45 @@ contract ProtocolHandler is TestBase, StdUtils, Actors {
ghost_totalSupplyAcrossChains.set(MESSENGER.superTokenInitDeploySalts(addr), currentValue + amount);
}

function handler_SupERC20Transfer(
uint256 tokenIndex,
address recipient,
uint256 amount
)
external
withActor(msg.sender)
{
vm.prank(currentActor());
OptimismSuperchainERC20(allSuperTokens[bound(tokenIndex, 0, allSuperTokens.length)]).transfer(recipient, amount);
}

function handler_SupERC20TransferFrom(
uint256 tokenIndex,
address from,
address to,
uint256 amount
)
external
withActor(msg.sender)
{
vm.prank(currentActor());
OptimismSuperchainERC20(allSuperTokens[bound(tokenIndex, 0, allSuperTokens.length)]).transferFrom(
from, to, amount
);
}

function handler_SupERC20Approve(
uint256 tokenIndex,
address spender,
uint256 amount
)
external
withActor(msg.sender)
{
vm.prank(currentActor());
OptimismSuperchainERC20(allSuperTokens[bound(tokenIndex, 0, allSuperTokens.length)]).transfer(spender, amount);
}

/// @notice deploy a remote token, that supertokens will be a representation of. They are never called, so there
/// is no need to actually deploy a contract for them
function _deployRemoteToken() internal {
Expand Down

0 comments on commit 49fa9e2

Please sign in to comment.