Skip to content

Commit

Permalink
Add BridgedKinto import and assertions for token supply checks in Min…
Browse files Browse the repository at this point in the history
…tBatchKintoScript.
  • Loading branch information
ylv-io committed Dec 18, 2024
1 parent 9bb22a6 commit c1163f8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions script/actions/multi-send-kinto.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity ^0.8.18;
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

import "@kinto-core-test/helpers/ArrayHelpers.sol";
import {BridgedKinto} from "@kinto-core/tokens/bridged/BridgedKinto.sol";
import {BridgedToken} from "@kinto-core/tokens/bridged/BridgedToken.sol";
import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol";
import {ERC20Multisender} from "@kinto-core-script/utils/ERC20MultiSender.sol";
Expand Down Expand Up @@ -39,14 +40,18 @@ contract MintBatchKintoScript is MigrationHelper {
totalAmount += amount;
}

address kintoToken = _getChainDeployment("KINTO");
BridgedKinto kintoToken = BridgedKinto(_getChainDeployment("KINTO"));

uint256 totalSupplyBefore = kintoToken.totalSupply();
// Burn tokens from RD
_handleOps(
abi.encodeWithSelector(BridgedToken.burn.selector, _getChainDeployment("RewardsDistributor"), totalAmount),
kintoToken
address(kintoToken)
);

// Check that tokens are burnt
assertEq(totalSupplyBefore - totalAmount, kintoToken.totalSupply());

uint256[] memory privKeys = new uint256[](2);
privKeys[0] = deployerPrivateKey;
privKeys[1] = hardwareWalletType;
Expand All @@ -69,7 +74,12 @@ contract MintBatchKintoScript is MigrationHelper {
batchAmounts[i - start] = amounts[i];
}

_handleOps(abi.encodeWithSelector(BridgedToken.batchMint.selector, batchUsers, batchAmounts), kintoToken);
_handleOps(
abi.encodeWithSelector(BridgedToken.batchMint.selector, batchUsers, batchAmounts), address(kintoToken)
);
}

// Check that tokens are minted
assertEq(totalSupplyBefore, kintoToken.totalSupply());
}
}

0 comments on commit c1163f8

Please sign in to comment.