Skip to content

Commit

Permalink
Change module path
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Nov 27, 2024
1 parent 3ef0507 commit 847dad2
Show file tree
Hide file tree
Showing 46 changed files with 62 additions and 62 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ To start developing on Teleporter, you'll need Solidity >= v0.8.25. [Foundry](ht

### Making an Issue

- Check that the issue you're filing doesn't already exist by searching under [issues](https://github.com/ava-labs/teleporter/issues).
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ava-labs/teleporter/issues/new/choose). Be sure to include a _title and clear description_ with as much relevant information as possible.
- Check that the issue you're filing doesn't already exist by searching under [issues](https://github.com/ava-labs/icm-contracts/issues).
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ava-labs/icm-contracts/issues/new/choose). Be sure to include a _title and clear description_ with as much relevant information as possible.

## Features

- If you want to start a discussion about the development of a new feature or the modfiication of an existing one, start a thread under GitHub [discussions](https://github.com/ava-labs/teleporter/discussions/categories/ideas).
- If you want to start a discussion about the development of a new feature or the modfiication of an existing one, start a thread under GitHub [discussions](https://github.com/ava-labs/icm-contracts/discussions/categories/ideas).
- Post a thread about your idea and why it should be added to Teleporter.
- Don't start working on a pull request until you've received positive feedback from the maintainers.

Expand Down Expand Up @@ -53,4 +53,4 @@ To start developing on Teleporter, you'll need Solidity >= v0.8.25. [Foundry](ht

### Do you have questions about the source code?

- Ask any question about ICM or ICM contracts under GitHub [discussions](https://github.com/ava-labs/teleporter/discussions/categories/q-a).
- Ask any question about ICM or ICM contracts under GitHub [discussions](https://github.com/ava-labs/icm-contracts/discussions/categories/q-a).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ From the root of the repo, the TeleporterMessenger contract can be deployed by c
Required arguments:
- `--version <version>` Specify the release version to deploy. These will all be of the form `v1.X.0`. Each `TeleporterMessenger` version can only send and receive messages from the **same** `TeleporterMessenger` version on another chain. You can see a list of released versions at https://github.com/ava-labs/teleporter/releases.
- `--version <version>` Specify the release version to deploy. These will all be of the form `v1.X.0`. Each `TeleporterMessenger` version can only send and receive messages from the **same** `TeleporterMessenger` version on another chain. You can see a list of released versions at https://github.com/ava-labs/icm-contracts/releases.
- `--rpc-url <url>` Specify the rpc url of the node to use.
Options:
Expand All @@ -132,7 +132,7 @@ Options:
To ensure that `TeleporterMessenger` can be deployed to the same address on every EVM based chain, it uses [Nick's Method](https://yamenmerhi.medium.com/nicks-method-ethereum-keyless-execution-168a6659479c) to deploy from a static deployer address. Teleporter costs exactly `10eth` in the Avalanche L1's native gas token to deploy, which must be sent to the deployer address.
`deploy_teleporter.sh` will send the necessary native tokens to the deployer address if it is provided with a private key for an account with sufficient funds. Alternatively, the deployer address can be funded externally. The deployer address for each version can be found by looking up the appropriate version at https://github.com/ava-labs/teleporter/releases and downloading `TeleporterMessenger_Deployer_Address_<VERSION>.txt`.
`deploy_teleporter.sh` will send the necessary native tokens to the deployer address if it is provided with a private key for an account with sufficient funds. Alternatively, the deployer address can be funded externally. The deployer address for each version can be found by looking up the appropriate version at https://github.com/ava-labs/icm-contracts/releases and downloading `TeleporterMessenger_Deployer_Address_<VERSION>.txt`.
Alternatively for new Avalanche L1s, the `TeleporterMessenger` contract can be directly included in the genesis file as documented [here](./contracts/teleporter/README.md#teleporter-messenger-contract-deployment).
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/governance/ValidatorSetSig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct ValidatorSetSigMessage {
* to deploy an `Ownable` target contract that is owned by an instance of this contract and adding the
* `onlyOwner` modifier to the functions that should be governed.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract ValidatorSetSig is ReentrancyGuard {
/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/ictt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Avalanche Interchain Token Transfer (ICTT) is an application that allows users to transfer tokens between L1s. The implementation is a set of smart contracts that are deployed across multiple L1s, and leverages [ICM](https://github.com/ava-labs/teleporter) for cross-chain communication.
Avalanche Interchain Token Transfer (ICTT) is an application that allows users to transfer tokens between L1s. The implementation is a set of smart contracts that are deployed across multiple L1s, and leverages [ICM](https://github.com/ava-labs/icm-contracts) for cross-chain communication.

Each token transferrer instance consists of one "home" contract and at least one but possibly many "remote" contracts. Each home contract instance manages one asset to be transferred out to `TokenRemote` instances. The home contract lives on the L1 where the asset to be transferred exists. A transfer consists of locking the asset as collateral on the home L1 and minting a representation of the asset on the remote L1. The remote contracts, each of which has a single specified home contract, live on other L1s that want to import the asset transferred by their specified home. The token transferrers are designed to be permissionless: anyone can register compatible `TokenRemote` instances to allow for transferring tokens from the `TokenHome` instance to that new `TokenRemote` instance. The home contract keeps track of token balances transferred to each `TokenRemote` instance, and handles returning the original tokens back to the user when assets are transferred back to the `TokenHome` instance. `TokenRemote` instances are registered with their home contract via an ICM message upon creation.

Expand Down Expand Up @@ -82,6 +82,6 @@ Note that the value returned by `totalNativeAssetSupply` is an upper bound on th

## ICM Message Fees

Fees can be optionally added to ICM messages in order to incentivize relayers to deliver them, as documented [here](https://github.com/ava-labs/teleporter/tree/main/contracts/teleporter#fees). The token transfer contracts in this repository allow for specifying any ERC20 token and amount to be used as the ICM message fee for single-hop transfers in either direction between `TokenHome` and `TokenRemote` instances. Fee amounts must be pre-approved to be spent by the token transfer contract before initiating a transfer.
Fees can be optionally added to ICM messages in order to incentivize relayers to deliver them, as documented [here](https://github.com/ava-labs/icm-contracts/tree/main/contracts/teleporter#fees). The token transfer contracts in this repository allow for specifying any ERC20 token and amount to be used as the ICM message fee for single-hop transfers in either direction between `TokenHome` and `TokenRemote` instances. Fee amounts must be pre-approved to be spent by the token transfer contract before initiating a transfer.

Multi-hop transfers between two `TokenRemote` instances involve two ICM messages: the first from the initiating `TokenRemote` instance to its home, and the second from its home to the destination `TokenRemote` instance. In the multi-hop case, the first message fee can be paid in any ERC20 token and amount (similar to the single-hop case), but the second message fee must be paid in-kind of the asset being transferred and is deducted from the amount being transferred. This restriction on the secondary message fee is necessary because the transaction on the intermediate chain routing the funds to the destination `TokenRemote` instance is not sent by the wallet performing the transfer. Because of this, it can not directly spend an arbitrary ERC20 token from that wallet. Using the asset being transferred for the optional secondary fee allows users to perform an incentivized multi-hop transfer without needing to make any interaction with the home themselves. If there is a need for the second message from the home to the destination `TokenRemote` instance to pay a fee in another asset, it is recommended to perform two single-hop transfers, which allows for specifying an arbitrary ERC20 token to be used for the fee of each.
2 changes: 1 addition & 1 deletion contracts/ictt/TokenHome/ERC20TokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
/**
* @title ERC20TokenHome
* @notice A non-upgradeable version of {ERC20TokenHomeUpgradeable} that calls the parent upgradeable contract's initialize function.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract ERC20TokenHome is ERC20TokenHomeUpgradeable {
constructor(
Expand Down
4 changes: 2 additions & 2 deletions contracts/ictt/TokenHome/ERC20TokenHomeUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
* @title ERC20TokenHomeUpgradeable
* @notice An {IERC20TokenHome} implementation that locks a specified ERC20 token to be sent to
* TokenRemote instances on other chains.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract ERC20TokenHomeUpgradeable is IERC20TokenHome, TokenHome {
using SafeERC20 for IERC20;
Expand Down Expand Up @@ -65,7 +65,7 @@ contract ERC20TokenHomeUpgradeable is IERC20TokenHome, TokenHome {
/**
* @notice Initializes the token TokenHome instance to send ERC20 tokens to TokenRemote instances on other chains.
* @param teleporterRegistryAddress The current blockchain ID's Teleporter registry
* address. See here for details: https://github.com/ava-labs/teleporter/tree/main/contracts/teleporter/registry
* address. See here for details: https://github.com/ava-labs/icm-contracts/tree/main/contracts/teleporter/registry
* @param teleporterManager Address that manages this contract's integration with the
* Teleporter registry and Teleporter versions.
* @param minTeleporterVersion Minimum Teleporter version supported by this contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenHome/NativeTokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
/**
* @title NativeTokenHome
* @notice A non-upgradeable version of {NativeTokenHomeUpgradeable} that calls the parent upgradeable contract's initialize function.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract NativeTokenHome is NativeTokenHomeUpgradeable {
constructor(
Expand Down
4 changes: 2 additions & 2 deletions contracts/ictt/TokenHome/NativeTokenHomeUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
* @title NativeTokenHomeUpgradeable
* @notice An {INativeTokenHome} implementation that locks the native token of this chain to be transferred to
* TokenRemote instances on other chains.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract NativeTokenHomeUpgradeable is INativeTokenHome, TokenHome {
using Address for address payable;
Expand Down Expand Up @@ -68,7 +68,7 @@ contract NativeTokenHomeUpgradeable is INativeTokenHome, TokenHome {
* @notice Initializes this token TokenHome instance to send native tokens to TokenRemote instances on other chains.
* Always uses a {tokenDecimals} value of 18 since it is the denomination of the native token of EVM instances.
* @param teleporterRegistryAddress The current blockchain ID's Teleporter registry
* address. See here for details: https://github.com/ava-labs/teleporter/tree/main/contracts/teleporter/registry
* address. See here for details: https://github.com/ava-labs/icm-contracts/tree/main/contracts/teleporter/registry
* @param teleporterManager Address that manages this contract's integration with the
* Teleporter registry and Teleporter versions.
* @param minTeleporterVersion Minimum Teleporter version supported by this contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenHome/TokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {IERC20} from "@openzeppelin/[email protected]/token/ERC20/ERC20.sol";
* This contract also handles multi-hop transfers, where tokens sent from a {TokenRemote}
* instance are forwarded to another {TokenRemote} instance.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
abstract contract TokenHome is
ITokenHome,
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenHome/interfaces/IERC20TokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ITokenHome} from "./ITokenHome.sol";
* @notice Interface for a ERC20 token "home" contract that locks its specified ERC20
* token on its chain to be transferred to supported remote token transfer contracts on other chains.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface IERC20TokenHome is IERC20TokenTransferrer, ITokenHome {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenHome/interfaces/INativeTokenHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ITokenHome} from "./ITokenHome.sol";
* @notice Interface for a native token "home" contract that locks the native token
* on its chain to be transferred to supported remote token transfer contracts on other chains.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface INativeTokenHome is INativeTokenTransferrer, ITokenHome {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenRemote/ERC20TokenRemote.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
/**
* @title ERC20TokenRemote
* @notice A non-upgradeable version of {ERC20TokenRemoteUpgradeable} that calls the parent upgradeable contract's initialize function.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract ERC20TokenRemote is ERC20TokenRemoteUpgradeable {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenRemote/ERC20TokenRemoteUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
* @title ERC20TokenRemoteUpgradeable
* @notice This contract is an {IERC20TokenTransferrer} that receives tokens from its specifed {TokenHome} instance,
* and represents the received tokens with an ERC20 token on this chain.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract ERC20TokenRemoteUpgradeable is IERC20TokenTransferrer, ERC20Upgradeable, TokenRemote {
// solhint-disable private-vars-leading-underscore
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenRemote/NativeTokenRemote.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
/**
* @title NativeTokenRemote
* @notice A non-upgradeable version of {NativeTokenRemoteUpgradeable} that calls the parent upgradeable contract's initialize function.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract NativeTokenRemote is NativeTokenRemoteUpgradeable {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {ICMInitializable} from "@utilities/ICMInitializable.sol";
* @title NativeTokenRemoteUpgradeable
* @notice This contract is an {INativeTokenRemote} that receives tokens from its specifed {TokenHome} instance,
* and represents the received tokens as the native token on this chain.
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
contract NativeTokenRemoteUpgradeable is
INativeTokenRemote,
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenRemote/TokenRemote.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {TokenScalingUtils} from "@utilities/TokenScalingUtils.sol";
* @dev Abstract contract for a token transferrer remote that receives tokens from its specified token TokenHome instance, and
* allows for burning that token to redeem the backing asset on the home chain, or transferring to other remotes.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
abstract contract TokenRemote is
ITokenRemote,
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/TokenRemote/interfaces/ITokenRemote.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {TeleporterFeeInfo} from "@teleporter/ITeleporterMessenger.sol";
/**
* @notice Settings for constructing a {ITokenRemote} contract.
* @param teleporterRegistryAddress The current blockchain ID's Teleporter registry
* address. See here for details: https://github.com/ava-labs/teleporter/tree/main/contracts/teleporter/registry.
* address. See here for details: https://github.com/ava-labs/icm-contracts/tree/main/contracts/teleporter/registry.
* @param teleporterManager Address that manages this contract's integration with the
* Teleporter registry and Teleporter versions.
* @param minTeleporterVersion Minimum Teleporter version supported by this contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/interfaces/IERC20TokenTransferrer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ITokenTransferrer, SendTokensInput, SendAndCallInput} from "./ITokenTran
/**
* @notice Interface for an Avalanche interchain token transferrer that sends ERC20 tokens to another chain.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface IERC20TokenTransferrer is ITokenTransferrer {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/interfaces/INativeTokenTransferrer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ITokenTransferrer, SendTokensInput, SendAndCallInput} from "./ITokenTran
/**
* @notice Interface for an Avalanche interchain token transferrer that sends native tokens to another chain.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface INativeTokenTransferrer is ITokenTransferrer {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/interfaces/ITokenTransferrer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ struct MultiHopCallMessage {
/**
* @notice Interface for an Avalanche interchain token transferrer that sends tokens to another chain.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface ITokenTransferrer is ITeleporterReceiver {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ictt/interfaces/IWrappedNativeToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {IERC20} from "@openzeppelin/[email protected]/token/ERC20/IERC20.sol";
* @notice Interface for a wrapped native token
* @dev Implements the {IERC20} interface, and adds deposit and withdraw functions.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface IWrappedNativeToken is IERC20 {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/teleporter/ITeleporterMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct TeleporterFeeInfo {
/**
* @dev Interface that describes functionalities for a cross-chain messenger implementing the Teleporter protcol.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface ITeleporterMessenger {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/teleporter/ITeleporterReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pragma solidity 0.8.25;
/**
* @dev Interface that cross-chain applications must implement to receive messages from Teleporter.
*
* @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md
*/
interface ITeleporterReceiver {
/**
Expand Down
Loading

0 comments on commit 847dad2

Please sign in to comment.