From 22fa0c0572ece5720ed9fdab74cbac271ceb347f Mon Sep 17 00:00:00 2001 From: marcomariscal Date: Wed, 3 Jul 2024 13:33:00 -0700 Subject: [PATCH] fix: use actual owner --- contracts-periphery/script/ApproveBatchSendTokens.s.sol | 3 ++- contracts-periphery/test/ApproveBatchSendTokens.t.sol | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/contracts-periphery/script/ApproveBatchSendTokens.s.sol b/contracts-periphery/script/ApproveBatchSendTokens.s.sol index 0ce27a100..5f29461a0 100644 --- a/contracts-periphery/script/ApproveBatchSendTokens.s.sol +++ b/contracts-periphery/script/ApproveBatchSendTokens.s.sol @@ -7,11 +7,12 @@ import {UmbraBatchSend} from "src/UmbraBatchSend.sol"; contract ApproveBatchSendTokens is Script { function run( + address _owner, address _umbraContractAddress, address _batchSendContractAddress, address[] calldata _tokenAddressesToApprove ) public { - vm.startBroadcast(); + vm.startBroadcast(_owner); for (uint256 _i = 0; _i < _tokenAddressesToApprove.length; _i++) { uint256 _currentAllowance = IERC20(_tokenAddressesToApprove[_i]).allowance( _batchSendContractAddress, _umbraContractAddress diff --git a/contracts-periphery/test/ApproveBatchSendTokens.t.sol b/contracts-periphery/test/ApproveBatchSendTokens.t.sol index cd7c29a0a..db28cd580 100644 --- a/contracts-periphery/test/ApproveBatchSendTokens.t.sol +++ b/contracts-periphery/test/ApproveBatchSendTokens.t.sol @@ -17,6 +17,7 @@ contract ApproveBatchSendTokensTest is Test { address constant WBTC_ADDRESS = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599; address[] tokensToApprove = [DAI_ADDRESS, LUSD_ADDRESS, RAI_ADDRESS, USDC_ADDRESS, USDT_ADDRESS, WBTC_ADDRESS]; + address owner = 0xB7EE870E2c49B2DEEe70003519cF056247Aac3D4; function setUp() public { vm.createSelectFork(vm.rpcUrl("mainnet"), 18_428_858); @@ -27,7 +28,10 @@ contract ApproveBatchSendTokensTest is Test { address[] memory tokenAddressesToApprove = new address[](1); tokenAddressesToApprove[0] = DAI_ADDRESS; approveTokensScript.run( - umbraContractAddressOnMainnet, batchSendContractAddressOnMainnet, tokenAddressesToApprove + owner, + umbraContractAddressOnMainnet, + batchSendContractAddressOnMainnet, + tokenAddressesToApprove ); assertEq( @@ -40,7 +44,7 @@ contract ApproveBatchSendTokensTest is Test { function test_ApproveMultipleTokens() public { approveTokensScript.run( - umbraContractAddressOnMainnet, batchSendContractAddressOnMainnet, tokensToApprove + owner, umbraContractAddressOnMainnet, batchSendContractAddressOnMainnet, tokensToApprove ); for (uint256 _i; _i < tokensToApprove.length; _i++) {