Skip to content

Commit

Permalink
πŸ‘·πŸ» πŸ“š βœ… Complete test and add misc docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyrharper committed Jul 10, 2024
1 parent e2840cc commit d73eb2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ contract Account is IAccount, IERC721Receiver {
}
}

// add argument for amount to deposit with minimum value
function setupAccount() external {
accountId = perpsMarketSNXV3.createAccount();
perpsMarketSNXV3.grantPermission({
Expand Down
2 changes: 1 addition & 1 deletion src/MarginPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ contract MarginPaymaster is IPaymaster, Zap {
uint128(actualGasCostInWei), // TODO: account for gas costs of postOp func
address(weth),
address(_USDC)
) * 110) / 100; // 10% slippage
) * 110) / 100; // allow for 10% slippage
uint256 USDCToSwapForWETH = costOfGasInUSDC;
address sender = abi.decode(context, (address));
uint256 availableUSDCInWallet = getUSDCAvailableInWallet(sender);
Expand Down
12 changes: 6 additions & 6 deletions test/MarginPaymaster.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ contract MarginPaymasterTest is Bootstrap {
assertEq(usdc.balanceOf(address(this)), 995 * 1e6);
assertEq(usdc.balanceOf(sender), 0);
assertEq(usdc.balanceOf(marginPaymasterAddress), 0);
// uint256 colAmount = perpsMarketProxy.getCollateralAmount(
// account.accountId(),
// sUSDId
// );
// assertGt(colAmount, 4 ether);
// assertLt(colAmount, 5 ether);
uint256 colAmount = perpsMarketProxy.getCollateralAmount(
account.accountId(),
sUSDId
);
assertGt(colAmount, 4 ether);
assertLt(colAmount, 5 ether);
}

function testTransferToWalletAndApprove() public {
Expand Down

0 comments on commit d73eb2b

Please sign in to comment.