Skip to content

Commit 38803e6

Browse files
authored
chore(contracts): simplify prover withdrawals (#82)
1 parent 2118b96 commit 38803e6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

contracts/.gas-snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ SuccinctVAppStateTest:test_Step_WhenValid() (gas: 120853)
111111
SuccinctVAppStateTest:test_Step_WhenValidTwice() (gas: 177445)
112112
SuccinctVAppWithdrawTest:test_RevertWithdraw_WhenBelowMinimum() (gas: 27115)
113113
SuccinctVAppWithdrawTest:test_RevertWithdraw_WhenZeroAddress() (gas: 26810)
114-
SuccinctVAppWithdrawTest:test_Withdraw_WhenValid() (gas: 503946)
114+
SuccinctVAppWithdrawTest:test_Withdraw_WhenValid() (gas: 503997)

contracts/src/SuccinctVApp.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,8 @@ contract SuccinctVApp is
224224
//
225225
// Otherwise if the `_to` is not a prover vault, we can just transfer the $PROVE directly.
226226
if (ISuccinctStaking(staking).isProver(_to)) {
227-
// Deposit $PROVE to mint $iPROVE, sending it to this contract.
228-
uint256 iPROVE = IERC4626(iProve).deposit(amount, address(this));
229-
230-
// Transfer the $iPROVE from this contract to the prover vault.
231-
IERC20(iProve).safeTransfer(_to, iPROVE);
227+
// Deposit $PROVE to mint $iPROVE, sending it to the prover vault.
228+
IERC4626(iProve).deposit(amount, _to);
232229
} else {
233230
// Transfer the $PROVE from this contract to the `_to` address.
234231
IERC20(prove).safeTransfer(_to, amount);

0 commit comments

Comments
 (0)