Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(owned-multicaller): implement remove-kill-fn #273

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/utils/OwnedMulticaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ contract OwnedMulticaller is Ownable {
_transferOwnership(owner_);
}

function kill() external onlyOwner {
selfdestruct(payable(_msgSender()));
}

function multiMint(
INSUnified rns,
uint256 parentId,
Expand All @@ -36,11 +32,12 @@ contract OwnedMulticaller is Ownable {
onlyOwner
returns (bool[] memory results, bytes[] memory returnDatas)
{
require(tos.length == callDatas.length && tos.length == values.length, "invalid length");
results = new bool[](tos.length);
returnDatas = new bytes[](tos.length);
uint256 length = tos.length;
require(length == callDatas.length && length == values.length, "invalid length");
results = new bool[](length);
returnDatas = new bytes[](length);

for (uint256 i; i < tos.length; ++i) {
for (uint256 i; i < length; ++i) {
(results[i], returnDatas[i]) = tos[i].call{ value: values[i] }(callDatas[i]);
results[i].handleRevert(returnDatas[i]);
}
Expand Down
Loading