Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 11 deletions contracts/evm/ERC20Custody.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ contract ERC20Custody is
/// @param to Destination address for the tokens.
/// @param token Address of the ERC20 token.
/// @param amount Amount of tokens to withdraw.
function withdraw(
address to,
address token,
uint256 amount
)
function withdraw(address to, address token, uint256 amount)
external
nonReentrant
onlyRole(WITHDRAWER_ROLE)
Expand Down Expand Up @@ -201,12 +197,7 @@ contract ERC20Custody is

/// @notice Deposits asset to custody and pay fee in zeta erc20.
/// @custom:deprecated This method is deprecated.
function deposit(
bytes calldata recipient,
IERC20 asset,
uint256 amount,
bytes calldata message
)
function deposit(bytes calldata recipient, IERC20 asset, uint256 amount, bytes calldata message)
external
nonReentrant
whenNotPaused
Expand Down
37 changes: 6 additions & 31 deletions contracts/evm/GatewayEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ contract GatewayEVM is
/// @dev This function can only be called by the TSS address and it is payable.
/// @param destination Address to call.
/// @param data Calldata to pass to the call.
function executeRevert(
address destination,
bytes calldata data,
RevertContext calldata revertContext
)
function executeRevert(address destination, bytes calldata data, RevertContext calldata revertContext)
public
payable
nonReentrant
Expand All @@ -128,11 +124,7 @@ contract GatewayEVM is
/// @param destination Address to call.
/// @param data Calldata to pass to the call.
/// @return The result of the call.
function execute(
MessageContext calldata messageContext,
address destination,
bytes calldata data
)
function execute(MessageContext calldata messageContext, address destination, bytes calldata data)
external
payable
nonReentrant
Expand Down Expand Up @@ -251,12 +243,7 @@ contract GatewayEVM is
/// @param amount Amount of tokens to deposit.
/// @param asset Address of the ERC20 token.
/// @param revertOptions Revert options.
function deposit(
address receiver,
uint256 amount,
address asset,
RevertOptions calldata revertOptions
)
function deposit(address receiver, uint256 amount, address asset, RevertOptions calldata revertOptions)
external
whenNotPaused
{
Expand All @@ -273,11 +260,7 @@ contract GatewayEVM is
/// @param receiver Address of the receiver.
/// @param payload Calldata to pass to the call.
/// @param revertOptions Revert options.
function depositAndCall(
address receiver,
bytes calldata payload,
RevertOptions calldata revertOptions
)
function depositAndCall(address receiver, bytes calldata payload, RevertOptions calldata revertOptions)
external
payable
whenNotPaused
Expand Down Expand Up @@ -322,11 +305,7 @@ contract GatewayEVM is
/// @param receiver Address of the receiver.
/// @param payload Calldata to pass to the call.
/// @param revertOptions Revert options.
function call(
address receiver,
bytes calldata payload,
RevertOptions calldata revertOptions
)
function call(address receiver, bytes calldata payload, RevertOptions calldata revertOptions)
external
whenNotPaused
{
Expand Down Expand Up @@ -444,11 +423,7 @@ contract GatewayEVM is
/// @param destination Address to call.
/// @param data Calldata to pass to the call.
/// @return The result of the call.
function _executeAuthenticatedCall(
MessageContext calldata messageContext,
address destination,
bytes calldata data
)
function _executeAuthenticatedCall(MessageContext calldata messageContext, address destination, bytes calldata data)
private
returns (bytes memory)
{
Expand Down
41 changes: 7 additions & 34 deletions contracts/evm/Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @param registryManager_ Address with REGISTRY_MANAGER_ROLE, authorized for all registry write actions.
/// @param gatewayEVM_ Address of the GatewayEVM contract for cross-chain messaging
/// @param coreRegistry_ Address of the CoreRegistry contract deployed on ZetaChain
function initialize(
address admin_,
address registryManager_,
address gatewayEVM_,
address coreRegistry_
)
function initialize(address admin_, address registryManager_, address gatewayEVM_, address coreRegistry_)
public
initializer
{
Expand Down Expand Up @@ -67,10 +62,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @notice onCall is called by the GatewayEVM when a cross-chain message is received
/// @param context Information about the cross-chain message
/// @param data The encoded function call to execute
function onCall(
MessageContext calldata context,
bytes calldata data
)
function onCall(MessageContext calldata context, bytes calldata data)
external
onlyRole(GATEWAY_ROLE)
whenNotPaused
Expand Down Expand Up @@ -101,12 +93,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @param gasZRC20 The address of the ZRC20 token that represents gas token for the chain.
/// @param registry Address of the Registry contract on the connected chain.
/// @param activation Whether activate or deactivate the chain
function changeChainStatus(
uint256 chainId,
address gasZRC20,
bytes calldata registry,
bool activation
)
function changeChainStatus(uint256 chainId, address gasZRC20, bytes calldata registry, bool activation)
external
onlyRegistry
whenNotPaused
Expand All @@ -120,11 +107,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @param chainId The ID of the chain
/// @param key The metadata key to update
/// @param value The new value for the metadata
function updateChainMetadata(
uint256 chainId,
string calldata key,
bytes calldata value
)
function updateChainMetadata(uint256 chainId, string calldata key, bytes calldata value)
external
onlyRegistry
whenNotPaused
Expand All @@ -138,11 +121,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @param chainId The ID of the chain where the contract is deployed
/// @param contractType The type of the contract (e.g., "connector", "gateway")
/// @param addressBytes The address of the contract
function registerContract(
uint256 chainId,
string calldata contractType,
bytes calldata addressBytes
)
function registerContract(uint256 chainId, string calldata contractType, bytes calldata addressBytes)
external
onlyRegistry
whenNotPaused
Expand Down Expand Up @@ -218,10 +197,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @dev This function can only be called by an address with the REGISTRY_MANAGER_ROLE.
/// @param chains Array of chain data structures to bootstrap
/// @param metadataEntries Array of chain metadata entries
function bootstrapChains(
ChainInfoDTO[] calldata chains,
ChainMetadataEntry[] calldata metadataEntries
)
function bootstrapChains(ChainInfoDTO[] calldata chains, ChainMetadataEntry[] calldata metadataEntries)
external
onlyRole(REGISTRY_MANAGER_ROLE)
whenNotPaused
Expand All @@ -243,10 +219,7 @@ contract Registry is BaseRegistry, IRegistry {
/// @dev This function can only be called by an address with the REGISTRY_MANAGER_ROLE.
/// @param contracts Array of contract data structures to bootstrap
/// @param configEntries Array of contract configuration entries
function bootstrapContracts(
ContractInfoDTO[] calldata contracts,
ContractConfigEntry[] calldata configEntries
)
function bootstrapContracts(ContractInfoDTO[] calldata contracts, ContractConfigEntry[] calldata configEntries)
external
onlyRole(REGISTRY_MANAGER_ROLE)
whenNotPaused
Expand Down
7 changes: 1 addition & 6 deletions contracts/evm/ZetaConnectorBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ abstract contract ZetaConnectorBase is

/// @notice Initializer for ZetaConnectors.
/// @dev Set admin as default admin and pauser, and tssAddress as tss role.
function initialize(
address gateway_,
address zetaToken_,
address tssAddress_,
address admin_
)
function initialize(address gateway_, address zetaToken_, address tssAddress_, address admin_)
public
virtual
initializer
Expand Down
7 changes: 1 addition & 6 deletions contracts/evm/ZetaConnectorNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract ZetaConnectorNative is ZetaConnectorBase {
using SafeERC20 for IERC20;

function initialize(
address gateway_,
address zetaToken_,
address tssAddress_,
address admin_
)
function initialize(address gateway_, address zetaToken_, address tssAddress_, address admin_)
public
override
initializer
Expand Down
13 changes: 2 additions & 11 deletions contracts/evm/ZetaConnectorNonNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ contract ZetaConnectorNonNative is ZetaConnectorBase {
/// @notice Max supply for minting.
uint256 public maxSupply;

function initialize(
address gateway_,
address zetaToken_,
address tssAddress_,
address admin_
)
function initialize(address gateway_, address zetaToken_, address tssAddress_, address admin_)
public
override
initializer
Expand All @@ -45,11 +40,7 @@ contract ZetaConnectorNonNative is ZetaConnectorBase {
/// @param amount The amount of tokens to withdraw.
/// @param internalSendHash A hash used for internal tracking of the transaction.
/// @dev This function can only be called by the TSS address.
function withdraw(
address to,
uint256 amount,
bytes32 internalSendHash
)
function withdraw(address to, uint256 amount, bytes32 internalSendHash)
external
override
nonReentrant
Expand Down
18 changes: 3 additions & 15 deletions contracts/evm/interfaces/IGatewayEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ interface IGatewayEVM is IGatewayEVMErrors, IGatewayEVMEvents {
/// @param destination Address to call.
/// @param data Calldata to pass to the call.
/// @param revertContext Revert context to pass to onRevert.
function executeRevert(
address destination,
bytes calldata data,
RevertContext calldata revertContext
)
function executeRevert(address destination, bytes calldata data, RevertContext calldata revertContext)
external
payable;

Expand All @@ -149,11 +145,7 @@ interface IGatewayEVM is IGatewayEVMErrors, IGatewayEVMEvents {
/// @param destination Address to call.
/// @param data Calldata to pass to the call.
/// @return The result of the call.
function execute(
MessageContext calldata messageContext,
address destination,
bytes calldata data
)
function execute(MessageContext calldata messageContext, address destination, bytes calldata data)
external
payable
returns (bytes memory);
Expand Down Expand Up @@ -189,11 +181,7 @@ interface IGatewayEVM is IGatewayEVMErrors, IGatewayEVMEvents {
/// @param receiver Address of the receiver.
/// @param payload Calldata to pass to the call.
/// @param revertOptions Revert options.
function depositAndCall(
address receiver,
bytes calldata payload,
RevertOptions calldata revertOptions
)
function depositAndCall(address receiver, bytes calldata payload, RevertOptions calldata revertOptions)
external
payable;

Expand Down
6 changes: 2 additions & 4 deletions contracts/evm/legacy/ZetaConnector.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ contract ZetaConnectorBase is ConnectorErrors, Pausable {
bytes32 internalSendHash
)
external
virtual
{ }
virtual { }

/**
* @dev Handler to receive errors from other chain.
Expand All @@ -191,6 +190,5 @@ contract ZetaConnectorBase is ConnectorErrors, Pausable {
bytes32 internalSendHash
)
external
virtual
{ }
virtual { }
}
37 changes: 18 additions & 19 deletions contracts/evm/legacy/ZetaConnector.eth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import "./ZetaInterfaces.sol";
* unlock.
*/
contract ZetaConnectorEth is ZetaConnectorBase {
constructor(
address zetaToken_,
address tssAddress_,
address tssAddressUpdater_,
address pauserAddress_
)
constructor(address zetaToken_, address tssAddress_, address tssAddressUpdater_, address pauserAddress_)
ZetaConnectorBase(zetaToken_, tssAddress_, tssAddressUpdater_, pauserAddress_)
{ }

Expand Down Expand Up @@ -68,9 +63,12 @@ contract ZetaConnectorEth is ZetaConnectorBase {
if (!success) revert ZetaTransferError();

if (message.length > 0) {
ZetaReceiver(destinationAddress).onZetaMessage(
ZetaInterfaces.ZetaMessage(zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message)
);
ZetaReceiver(destinationAddress)
.onZetaMessage(
ZetaInterfaces.ZetaMessage(
zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message
)
);
}

emit ZetaReceived(zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message, internalSendHash);
Expand Down Expand Up @@ -99,16 +97,17 @@ contract ZetaConnectorEth is ZetaConnectorBase {
if (!success) revert ZetaTransferError();

if (message.length > 0) {
ZetaReceiver(zetaTxSenderAddress).onZetaRevert(
ZetaInterfaces.ZetaRevert(
zetaTxSenderAddress,
sourceChainId,
destinationAddress,
destinationChainId,
remainingZetaValue,
message
)
);
ZetaReceiver(zetaTxSenderAddress)
.onZetaRevert(
ZetaInterfaces.ZetaRevert(
zetaTxSenderAddress,
sourceChainId,
destinationAddress,
destinationChainId,
remainingZetaValue,
message
)
);
}

emit ZetaReverted(
Expand Down
Loading
Loading