Skip to content

Commit

Permalink
fix: use actual owner
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Jul 3, 2024
1 parent e31deb8 commit 22fa0c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion contracts-periphery/script/ApproveBatchSendTokens.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions contracts-periphery/test/ApproveBatchSendTokens.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand All @@ -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++) {
Expand Down

0 comments on commit 22fa0c0

Please sign in to comment.