Skip to content

Commit

Permalink
fix(protocol): fix supportsInterface in BaseVault, fix typo and visib…
Browse files Browse the repository at this point in the history
…ility (#16600)
  • Loading branch information
dantaik committed Apr 3, 2024
1 parent eba19c7 commit f6efe97
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
15 changes: 5 additions & 10 deletions packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,11 @@ contract Bridge is EssentialContract, IBridge {
/// @notice Returns invocation delay values.
/// @dev Bridge contract deployed on L1 shall use a non-zero value for better
/// security.
/// @return invocationDelay_ The minimal delay in second before a message can be executed since
/// and the time it was received on the this chain.
/// @return invocationExtraDelay_ The extra delay in second (to be added to invocationDelay) if
/// the transactor is not the preferredExecutor who proved this message.
function getInvocationDelays()
public
view
virtual
returns (uint256 invocationDelay_, uint256 invocationExtraDelay_)
{
/// @return The minimal delay in second before a message can be executed since and the time it
/// was received on the this chain.
/// @return The extra delay in second (to be added to invocationDelay) if the transactor is not
/// the preferredExecutor who proved this message.
function getInvocationDelays() public view virtual returns (uint256, uint256) {
if (LibNetwork.isEthereumMainnetOrTestnet(block.chainid)) {
// For Taiko mainnet and public testnets
// 384 seconds = 6.4 minutes = one ethereum epoch
Expand Down
1 change: 1 addition & 0 deletions packages/protocol/contracts/common/AddressResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ abstract contract AddressResolver is IAddressResolver, Initializable {
_;
}

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
Expand Down
5 changes: 3 additions & 2 deletions packages/protocol/contracts/tokenvault/BaseVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ abstract contract BaseVault is
/// @notice Checks if the contract supports the given interface.
/// @param _interfaceId The interface identifier.
/// @return true if the contract supports the interface, false otherwise.
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
return _interfaceId == type(IRecallableSender).interfaceId;
function supportsInterface(bytes4 _interfaceId) public pure virtual override returns (bool) {
return _interfaceId == type(IRecallableSender).interfaceId
|| _interfaceId == type(IMessageInvocable).interfaceId;
}

/// @notice Returns the name of the vault.
Expand Down
1 change: 1 addition & 0 deletions packages/protocol/contracts/tokenvault/BridgedERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ contract BridgedERC1155 is EssentialContract, IERC1155MetadataURIUpgradeable, ER
bytes memory /*_data*/
)
internal
view
override
{
if (_to == address(this)) revert BTOKEN_CANNOT_RECEIVE();
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/tokenvault/BridgedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract BridgedERC20 is

/// @notice Set the snapshoter address.
/// @param _snapshooter snapshooter address.
function setSnapshoter(address _snapshooter) external onlyOwner {
function setSnapshooter(address _snapshooter) external onlyOwner {
snapshooter = _snapshooter;
}

Expand Down
1 change: 1 addition & 0 deletions packages/protocol/contracts/tokenvault/BridgedERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable {
uint256 /*_batchSize*/
)
internal
view
override
{
if (_to == address(this)) revert BTOKEN_CANNOT_RECEIVE();
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/tokenvault/ERC1155Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ contract ERC1155Vault is BaseNFTVault, ERC1155ReceiverUpgradeable {
/// @return true if supports, else otherwise.
function supportsInterface(bytes4 interfaceId)
public
view
pure
override(BaseVault, ERC1155ReceiverUpgradeable)
returns (bool)
{
Expand Down

0 comments on commit f6efe97

Please sign in to comment.