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

chore(protocol): apply small improvements #16647

Merged
merged 14 commits into from
Apr 4, 2024
129 changes: 0 additions & 129 deletions packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol

This file was deleted.

9 changes: 8 additions & 1 deletion packages/protocol/contracts/team/airdrop/MerkleClaimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ abstract contract MerkleClaimable is EssentialContract {
_setConfig(_claimStart, _claimEnd, _merkleRoot);
}

function _verifyClaim(bytes memory data, bytes32[] calldata proof) internal ongoingClaim {
function _verifyClaim(
bytes memory data,
bytes32[] calldata proof
)
internal
whenNotPaused
ongoingClaim
{
bytes32 hash = keccak256(abi.encode("CLAIM_TAIKO_AIRDROP", data));

if (isClaimed[hash]) revert CLAIMED_ALREADY();
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/thirdparty/optimism/Bytes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ library Bytes {
}

/// @notice Slices a byte array with a given starting index up to the end of the original byte
/// array. Returns a new array rathern than a pointer to the original.
/// array. Returns a new array rather than a pointer to the original.
/// @param _bytes Byte array to slice.
/// @param _start Starting index of the slice.
/// @return Slice of the input byte array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,8 @@ library MerkleTrie {
function _parseProof(bytes[] memory _proof) private pure returns (TrieNode[] memory proof_) {
uint256 length = _proof.length;
proof_ = new TrieNode[](length);
for (uint256 i = 0; i < length;) {
for (uint256 i = 0; i < length; ++i) {
proof_[i] = TrieNode({ encoded: _proof[i], decoded: RLPReader.readList(_proof[i]) });
unchecked {
++i;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/tokenvault/BridgedERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable {

// The token URI here is not important as the client will have to read the URI from the
// canonical contract to fetch meta data.
__ERC1155_init(LibBridgedToken.buildURI(_srcToken, _srcChainId));
__ERC1155_init(LibBridgedToken.buildURI(_srcToken, _srcChainId, ""));

srcToken = _srcToken;
srcChainId = _srcChainId;
Expand Down
6 changes: 1 addition & 5 deletions packages/protocol/contracts/tokenvault/BridgedERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable {
// https://github.com/crytic/slither/wiki/Detector-Documentation#abi-encodePacked-collision
// The abi.encodePacked() call below takes multiple dynamic arguments. This is known and
// considered acceptable in terms of risk.
return string(
abi.encodePacked(
LibBridgedToken.buildURI(srcToken, srcChainId), Strings.toString(_tokenId)
)
);
return LibBridgedToken.buildURI(srcToken, srcChainId, Strings.toString(_tokenId));
}

/// @notice Gets the canonical token's address and chain ID.
Expand Down
6 changes: 4 additions & 2 deletions packages/protocol/contracts/tokenvault/LibBridgedToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ library LibBridgedToken {

function buildURI(
address _srcToken,
uint256 _srcChainId
uint256 _srcChainId,
string memory _extraParams
)
internal
pure
Expand All @@ -66,7 +67,8 @@ library LibBridgedToken {
Strings.toHexString(uint160(_srcToken), 20),
"@",
Strings.toString(_srcChainId),
"/tokenURI?uint256="
"/tokenURI?uint256=",
_extraParams
)
);
}
Expand Down
1 change: 0 additions & 1 deletion packages/protocol/test/TaikoTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import "../contracts/L2/DelegateOwner.sol";

import "../contracts/team/TimelockTokenPool.sol";
import "../contracts/team/airdrop/ERC20Airdrop.sol";
import "../contracts/team/airdrop/ERC20Airdrop2.sol";
import "../contracts/team/airdrop/ERC721Airdrop.sol";

import "../test/common/erc20/FreeMintERC20.sol";
Expand Down
156 changes: 0 additions & 156 deletions packages/protocol/test/team/airdrop/ERC20Airdrop2.t.sol

This file was deleted.

Loading