Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
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 @@ -225,10 +204,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 @@ -250,10 +226,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 @@ -162,11 +162,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 @@ -176,11 +172,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 @@ -229,11 +221,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
7 changes: 1 addition & 6 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
7 changes: 1 addition & 6 deletions contracts/evm/legacy/ZetaConnector.non-eth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ contract ZetaConnectorNonEth is ZetaConnectorBase {

event MaxSupplyUpdated(address callerAddress, uint256 newMaxSupply);

constructor(
address zetaTokenAddress_,
address tssAddress_,
address tssAddressUpdater_,
address pauserAddress_
)
constructor(address zetaTokenAddress_, address tssAddress_, address tssAddressUpdater_, address pauserAddress_)
ZetaConnectorBase(zetaTokenAddress_, tssAddress_, tssAddressUpdater_, pauserAddress_)
{ }

Expand Down
6 changes: 1 addition & 5 deletions contracts/evm/legacy/ZetaInterfaces.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ interface ZetaTokenConsumer {
external
returns (uint256);

function getEthFromZeta(
address destinationAddress,
uint256 minAmountOut,
uint256 zetaTokenAmount
)
function getEthFromZeta(address destinationAddress, uint256 minAmountOut, uint256 zetaTokenAmount)
external
returns (uint256);

Expand Down
16 changes: 3 additions & 13 deletions contracts/helpers/BaseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ abstract contract BaseRegistry is
/// @param contractType The type of the contract
/// @return active Whether the contract is active
/// @return addressBytes The address of the contract
function getContractInfo(
uint256 chainId,
string calldata contractType
)
function getContractInfo(uint256 chainId, string calldata contractType)
external
view
returns (bool active, bytes memory addressBytes)
Expand All @@ -311,11 +308,7 @@ abstract contract BaseRegistry is
/// @param contractType The type of the contract
/// @param key The configuration key to retrieve
/// @return The value of the requested configuration
function getContractConfiguration(
uint256 chainId,
string calldata contractType,
string calldata key
)
function getContractConfiguration(uint256 chainId, string calldata contractType, string calldata key)
external
view
returns (bytes memory)
Expand Down Expand Up @@ -356,10 +349,7 @@ abstract contract BaseRegistry is
/// @param originChainId The ID of the foreign chain
/// @param originAddress The address or identifier of the asset on its native chain.
/// @return The address of the corresponding ZRC20 token on ZetaChain.
function getZRC20AddressByForeignAsset(
uint256 originChainId,
bytes calldata originAddress
)
function getZRC20AddressByForeignAsset(uint256 originChainId, bytes calldata originAddress)
external
view
returns (address)
Expand Down
16 changes: 3 additions & 13 deletions contracts/helpers/interfaces/IBaseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ interface IBaseRegistry is IBaseRegistryErrors, IBaseRegistryEvents {
/// @param contractType The type of the contract.
/// @return active Whether the contract is active.
/// @return addressBytes The address of the contract.
function getContractInfo(
uint256 chainId,
string calldata contractType
)
function getContractInfo(uint256 chainId, string calldata contractType)
external
view
returns (bool active, bytes memory addressBytes);
Expand All @@ -295,11 +292,7 @@ interface IBaseRegistry is IBaseRegistryErrors, IBaseRegistryEvents {
/// @param contractType The type of the contract.
/// @param key The configuration key to retrieve.
/// @return The value of the requested configuration.
function getContractConfiguration(
uint256 chainId,
string calldata contractType,
string calldata key
)
function getContractConfiguration(uint256 chainId, string calldata contractType, string calldata key)
external
view
returns (bytes memory);
Expand Down Expand Up @@ -328,10 +321,7 @@ interface IBaseRegistry is IBaseRegistryErrors, IBaseRegistryEvents {
/// @param originChainId The ID of the foreign chain.
/// @param originAddress The address or identifier of the asset on its native chain.
/// @return The address of the corresponding ZRC20 token on ZetaChain.
function getZRC20AddressByForeignAsset(
uint256 originChainId,
bytes calldata originAddress
)
function getZRC20AddressByForeignAsset(uint256 originChainId, bytes calldata originAddress)
external
view
returns (address);
Expand Down
Loading
Loading