Skip to content

Commit

Permalink
fix: fix if logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Aug 9, 2023
1 parent 6136cde commit 1a2eb1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 793 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager
uint256 length = registers.length;
if (length == 0) return;

bool[] memory statuses = new bool[](length);
bool[] memory successes = new bool[](length);
bytes[] memory returnDatas = new bytes[](length);
bytes memory callData = abi.encodePacked(callbackFnSig, inputs);
bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));

for (uint256 i; i < length; ) {
(statuses[i], returnDatas[i]) = registers[i].call(callData);
if (statuses[i]) {
(statuses[i], returnDatas[i]) = registers[i].call(proxyCallData);
(successes[i], returnDatas[i]) = registers[i].call(callData);
if (!successes[i]) {
(successes[i], returnDatas[i]) = registers[i].call(proxyCallData);
}

unchecked {
++i;
}
}

emit Notified(callData, registers, statuses, returnDatas);
emit Notified(callData, registers, successes, returnDatas);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions logs/contract_code_sizes.log
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
············································|···························|·················
| LibTUint256Slot · 0.044 · │
············································|···························|·················
| MainchainBridgeManager · 18.819 · │
| MainchainBridgeManager · 18.818 · │
············································|···························|·················
| MainchainGatewayV2 · 17.699 · │
············································|···························|·················
Expand All @@ -71,7 +71,7 @@
············································|···························|·················
| MockBridge · 1.232 · │
············································|···························|·················
| MockBridgeManager · 10.433 · │
| MockBridgeManager · 10.432 · │
············································|···························|·················
| MockBridgeReward · 6.368 · │
············································|···························|·················
Expand Down Expand Up @@ -103,7 +103,7 @@
············································|···························|·················
| MockPrecompile · 3.794 · │
············································|···························|·················
| MockRoninBridgeManager · 23.915 · │
| MockRoninBridgeManager · 23.914 · │
············································|···························|·················
| MockRoninGatewayV2Extended · 20.397 · │
············································|···························|·················
Expand Down Expand Up @@ -131,7 +131,7 @@
············································|···························|·················
| ProxyAdmin · 1.604 · │
············································|···························|·················
| RoninBridgeManager · 23.915 · │
| RoninBridgeManager · 23.914 · │
············································|···························|·················
| RoninGatewayV2 · 20.090 · │
············································|···························|·················
Expand Down
Loading

0 comments on commit 1a2eb1b

Please sign in to comment.