diff --git a/cairo/src/contracts/token/extensions/fast_hyp_erc20.cairo b/cairo/src/contracts/token/extensions/fast_hyp_erc20.cairo index 8b13789..ac1040e 100644 --- a/cairo/src/contracts/token/extensions/fast_hyp_erc20.cairo +++ b/cairo/src/contracts/token/extensions/fast_hyp_erc20.cairo @@ -1 +1,33 @@ +#[starknet::interface] +pub trait IFastHypERC20Collateral { + fn initialize(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod FastHypERC20Collateral { + #[storage] + struct Storage { + wrapped_token: u256, + mailbox: u256, + } + + fn constructor() {} + + impl FastHypERC20CollateralImpl of super::IFastHypERC20Collateral { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn handle(ref self: ContractState, origin: u32, sender: u256, message: u256) {} + + fn fast_transfer_to(ref self: ContractState, recipient: u256, amount: u256) {} + + fn fast_receive_from(ref self: ContractState, sender: u256, amount: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/fast_hyp_erc20_collateral.cairo b/cairo/src/contracts/token/extensions/fast_hyp_erc20_collateral.cairo index 8b13789..38ec83a 100644 --- a/cairo/src/contracts/token/extensions/fast_hyp_erc20_collateral.cairo +++ b/cairo/src/contracts/token/extensions/fast_hyp_erc20_collateral.cairo @@ -1 +1,32 @@ +#[starknet::interface] +pub trait IFastHypERC20 { + fn initialize(ref self: TState); + fn balance_of(self: @TState, account: u256) -> u256; +} +// Since this contract inherits form HyerErc20, to avoid having it as component, +// we need to reimplement all the methods of the IHyerErc20 trait. +#[starknet::contract] +pub mod FastHypERC20 { + #[storage] + struct Storage {} + + fn constructor() {} + + impl FastHypERC20Impl of super::IFastHypERC20 { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn handle(ref self: ContractState, origin: u32, sender: u256, message: u256) {} + + fn fast_transfer_to(ref self: ContractState, recipient: u256, amount: u256) {} + + fn fast_receive_from(ref self: ContractState, sender: u256, amount: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_erc20_collateral_vault_deposit.cairo b/cairo/src/contracts/token/extensions/hyp_erc20_collateral_vault_deposit.cairo index 8b13789..6914c8b 100644 --- a/cairo/src/contracts/token/extensions/hyp_erc20_collateral_vault_deposit.cairo +++ b/cairo/src/contracts/token/extensions/hyp_erc20_collateral_vault_deposit.cairo @@ -1 +1,42 @@ +#[starknet::interface] +pub trait IHypERC20CollateralVaultDeposit { + fn initialize(ref self: TState); + fn sweep(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod HypERC20CollateralVaultDeposit { + #[storage] + struct Storage { + vault: u256, + asset_deposited: u256, + } + + fn constructor() {} + + impl HypERC20CollateralVaultDepositImpl of super::IHypERC20CollateralVaultDeposit< + ContractState + > { + fn initialize(ref self: ContractState) {} + + fn sweep(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn deposit_into_vault(ref self: ContractState, amount: u256) {} + + fn withdraw_from_vault(ref self: ContractState, amount: u256, recipient: u256) {} + + fn transfer_from_sender(ref self: ContractState, amount: u256) -> u256 { + 0 + } + + fn transfer_to(ref self: ContractState, recipient: u256, amount: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_erc721_URI_collateral.cairo b/cairo/src/contracts/token/extensions/hyp_erc721_URI_collateral.cairo index 8b13789..009fc25 100644 --- a/cairo/src/contracts/token/extensions/hyp_erc721_URI_collateral.cairo +++ b/cairo/src/contracts/token/extensions/hyp_erc721_URI_collateral.cairo @@ -1 +1,34 @@ +#[starknet::interface] +pub trait IHypERC721URICollateral { + fn initialize(ref self: TState); + fn owner_of(self: @TState, token_id: u256) -> u256; + fn balance_of(self: @TState, account: u256) -> u256; +} +#[starknet::contract] +pub mod HypERC721URICollateral { + #[storage] + struct Storage { + wrapped_token: u256, + mailbox: u256, + } + + fn constructor() {} + + impl HypERC721URICollateralImpl of super::IHypERC721URICollateral { + fn initialize(ref self: ContractState) {} + + fn owner_of(self: @ContractState, token_id: u256) -> u256 { + 0 + } + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, token_id: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_erc721_URI_storage.cairo b/cairo/src/contracts/token/extensions/hyp_erc721_URI_storage.cairo index 8b13789..db5e0c5 100644 --- a/cairo/src/contracts/token/extensions/hyp_erc721_URI_storage.cairo +++ b/cairo/src/contracts/token/extensions/hyp_erc721_URI_storage.cairo @@ -1 +1,48 @@ +#[starknet::interface] +pub trait IHypERC721URIStorage { + fn initialize(ref self: TState); + fn balance_of(self: @TState, account: u256) -> u256; + fn token_uri(self: @TState, token_id: u256) -> u256; + fn supports_interface(self: @TState, interface_id: u256) -> bool; +} +#[starknet::contract] +pub mod HypERC721URIStorage { + #[storage] + struct Storage { + mailbox: u256, + } + + fn constructor() {} + + impl HypERC721URIStorageImpl of super::IHypERC721URIStorage { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + + fn token_uri(self: @ContractState, token_id: u256) -> u256 { + 0 + } + + fn supports_interface(self: @ContractState, interface_id: u256) -> bool { + false + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, token_id: u256) -> u256 { + 0 + } + + fn transfer_to(ref self: ContractState, recipient: u256, token_id: u256, token_uri: u256) {} + + fn before_token_transfer( + ref self: ContractState, from: u256, to: u256, token_id: u256, batch_size: u256 + ) {} + + fn burn(ref self: ContractState, token_id: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_fiat_token.cairo b/cairo/src/contracts/token/extensions/hyp_fiat_token.cairo index 8b13789..86ca0b2 100644 --- a/cairo/src/contracts/token/extensions/hyp_fiat_token.cairo +++ b/cairo/src/contracts/token/extensions/hyp_fiat_token.cairo @@ -1 +1,33 @@ +#[starknet::interface] +pub trait IHypFiatToken { + fn initialize(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod HypFiatToken { + #[storage] + struct Storage { + fiat_token: u256, + mailbox: u256, + } + + fn constructor() {} + + impl HypFiatTokenImpl of super::IHypFiatToken { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, amount: u256) -> u256 { + 0 + } + + fn transfer_to(ref self: ContractState, recipient: u256, amount: u256, metadata: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_native_scaled.cairo b/cairo/src/contracts/token/extensions/hyp_native_scaled.cairo index 8b13789..1e427d7 100644 --- a/cairo/src/contracts/token/extensions/hyp_native_scaled.cairo +++ b/cairo/src/contracts/token/extensions/hyp_native_scaled.cairo @@ -1 +1,36 @@ +#[starknet::interface] +pub trait IHypNativeScaled { + fn initialize(ref self: TState); + fn transfer_remote(self: @TState, destination: u32, recipient: u256, amount: u256) -> u256; + fn balance_of(self: @TState, account: u256) -> u256; +} +#[starknet::contract] +pub mod HypNativeScaled { + #[storage] + struct Storage { + scale: u256, + mailbox: u256, + } + + fn constructor() {} + + impl HypNativeScaledImpl of super::IHypNativeScaled { + fn initialize(ref self: ContractState) {} + + fn transfer_remote( + self: @ContractState, destination: u32, recipient: u256, amount: u256 + ) -> u256 { + 0 + } + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_to(ref self: ContractState, recipient: u256, amount: u256, metadata: u256) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_xerc20.cairo b/cairo/src/contracts/token/extensions/hyp_xerc20.cairo index 8b13789..acfa803 100644 --- a/cairo/src/contracts/token/extensions/hyp_xerc20.cairo +++ b/cairo/src/contracts/token/extensions/hyp_xerc20.cairo @@ -1 +1,35 @@ +#[starknet::interface] +pub trait IHypXERC20 { + fn initialize(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod HypXERC20 { + #[storage] + struct Storage { + xerc20: u256, + mailbox: u256, + } + + fn constructor() {} + + impl HypXERC20Impl of super::IHypXERC20 { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, amount_or_id: u256) -> u256 { + 0 + } + + fn transfer_to( + ref self: ContractState, recipient: u256, amount_or_id: u256, metadata: u256 + ) {} + } +} diff --git a/cairo/src/contracts/token/extensions/hyp_xerc20_lockbox.cairo b/cairo/src/contracts/token/extensions/hyp_xerc20_lockbox.cairo index 8b13789..480000a 100644 --- a/cairo/src/contracts/token/extensions/hyp_xerc20_lockbox.cairo +++ b/cairo/src/contracts/token/extensions/hyp_xerc20_lockbox.cairo @@ -1 +1,38 @@ +#[starknet::interface] +pub trait IHypXERC20Lockbox { + fn initialize(ref self: TState, hook: u256, ism: u256, owner: u256); + fn approve_lockbox(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod HypXERC20Lockbox { + #[storage] + struct Storage { + lockbox: u256, + xerc20: u256, + wrapped_token: u256, + mailbox: u256, + } + + fn constructor() {} + + impl HypXERC20LockboxImpl of super::IHypXERC20Lockbox { + fn initialize(ref self: ContractState, hook: u256, ism: u256, owner: u256) {} + + fn approve_lockbox(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, amount: u256) -> u256 { + 0 + } + + fn transfer_to(ref self: ContractState, recipient: u256, amount: u256, metadata: u256) {} + } +} diff --git a/cairo/src/contracts/token/hyp_erc20.cairo b/cairo/src/contracts/token/hyp_erc20.cairo index 911a920..77b9f14 100644 --- a/cairo/src/contracts/token/hyp_erc20.cairo +++ b/cairo/src/contracts/token/hyp_erc20.cairo @@ -1,23 +1,33 @@ #[starknet::interface] -pub mod IHypErc20 { +pub trait IHypErc20 { fn initialize(ref self: TState); - fn decimals() -> u8; - fn balance_of(ref self: TState) -> Uint256; + fn decimals(self: @TState) -> u8; + fn balance_of(self: @TState) -> u256; } #[starknet::contract] pub mod HypErc20 { - #[storage] struct Storage {} fn constructor() {} impl HypErc20Impl of super::IHypErc20 { - fn initialize() {} + fn initialize(ref self: ContractState) {} - fn decimals() -> u8 {0} + fn decimals(self: @ContractState) -> u8 { + 0 + } - fn balance_of(ref self: ContractState) -> Uint256 {0} + fn balance_of(self: @ContractState) -> u256 { + 0 + } } -} \ No newline at end of file + + #[generate_trait] + impl InternaImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState) {} + + fn transfer_to_recipient(ref self: ContractState) {} + } +} diff --git a/cairo/src/contracts/token/hyp_erc20_collateral.cairo b/cairo/src/contracts/token/hyp_erc20_collateral.cairo index 8b13789..66dda91 100644 --- a/cairo/src/contracts/token/hyp_erc20_collateral.cairo +++ b/cairo/src/contracts/token/hyp_erc20_collateral.cairo @@ -1 +1,28 @@ +#[starknet::interface] +pub trait IHypErc20Collateral { + fn initialize(ref self: TState); + fn balance_of(self: @TState) -> u256; +} +#[starknet::contract] +pub mod HypErc20 { + #[storage] + struct Storage {} + + fn constructor() {} + + impl HypErc20CollateralImpl of super::IHypErc20Collateral { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternaImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState) {} + + fn transfer_to(ref self: ContractState) {} + } +} diff --git a/cairo/src/contracts/token/hyp_erc721.cairo b/cairo/src/contracts/token/hyp_erc721.cairo index 8b13789..cdc3636 100644 --- a/cairo/src/contracts/token/hyp_erc721.cairo +++ b/cairo/src/contracts/token/hyp_erc721.cairo @@ -1 +1,29 @@ +#[starknet::interface] +pub trait IHypErc721 { + fn initialize(ref self: TState); + fn balance_of(self: @TState) -> u256; +} + +#[starknet::contract] +pub mod HypErc721 { + #[storage] + struct Storage {} + + fn constructor() {} + + impl HypErc721Impl of super::IHypErc721 { + fn initialize(ref self: ContractState) {} + + fn balance_of(self: @ContractState) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, token_id: u256) {} + + fn transfer_to_recipient(ref self: ContractState, recipient: u256, token_id: u256) {} + } +} diff --git a/cairo/src/contracts/token/hyp_erc721_collateral.cairo b/cairo/src/contracts/token/hyp_erc721_collateral.cairo index 8b13789..e41e9b5 100644 --- a/cairo/src/contracts/token/hyp_erc721_collateral.cairo +++ b/cairo/src/contracts/token/hyp_erc721_collateral.cairo @@ -1 +1,35 @@ +#[starknet::interface] +pub trait IHypErc721Collateral { + fn initialize(ref self: TState); + fn owner_of(self: @TState, token_id: u256) -> u256; + fn balance_of(self: @TState, account: u256) -> u256; +} +#[starknet::contract] +pub mod HypErc721Collateral { + #[storage] + struct Storage { + wrapped_token: u256, + } + + fn constructor() {} + + impl HypErc721CollateralImpl of super::IHypErc721Collateral { + fn initialize(ref self: ContractState) {} + + fn owner_of(self: @ContractState, token_id: u256) -> u256 { + 0 + } + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, token_id: u256) {} + + fn transfer_to_recipient(ref self: ContractState, recipient: u256, token_id: u256) {} + } +} diff --git a/cairo/src/contracts/token/hyp_native.cairo b/cairo/src/contracts/token/hyp_native.cairo index 8b13789..2d9ba90 100644 --- a/cairo/src/contracts/token/hyp_native.cairo +++ b/cairo/src/contracts/token/hyp_native.cairo @@ -1 +1,37 @@ +#[starknet::interface] +pub trait IHypNative { + fn initialize(ref self: TState); + fn transfer_remote(ref self: TState, destination: u32, recipient: u256, amount: u256) -> u256; + fn balance_of(self: @TState, account: u256) -> u256; +} +#[starknet::contract] +pub mod HypNative { + #[storage] + struct Storage {} + + fn constructor() {} + + impl HypNativeImpl of super::IHypNative { + fn initialize(ref self: ContractState) {} + + fn transfer_remote( + ref self: ContractState, destination: u32, recipient: u256, amount: u256 + ) -> u256 { + 0 + } + + fn balance_of(self: @ContractState, account: u256) -> u256 { + 0 + } + } + + #[generate_trait] + impl InternalImpl of InternalTrait { + fn transfer_from_sender(ref self: ContractState, amount: u256) -> u256 { + 0 + } + + fn transfer_to_recipient(ref self: ContractState, recipient: u256, amount: u256) {} + } +} diff --git a/cairo/src/contracts/token/interfaces/ifiat_token.cairo b/cairo/src/contracts/token/interfaces/ifiat_token.cairo index 8b13789..a6d0117 100644 --- a/cairo/src/contracts/token/interfaces/ifiat_token.cairo +++ b/cairo/src/contracts/token/interfaces/ifiat_token.cairo @@ -1 +1,5 @@ - +#[starknet::interface] +pub trait IFiatToken { + fn burn(ref self: TState, amount: u256); + fn mint(ref self: TState, amount: u256); +} diff --git a/cairo/src/contracts/token/interfaces/ixerc20.cairo b/cairo/src/contracts/token/interfaces/ixerc20.cairo index 8b13789..cbd0111 100644 --- a/cairo/src/contracts/token/interfaces/ixerc20.cairo +++ b/cairo/src/contracts/token/interfaces/ixerc20.cairo @@ -1 +1,11 @@ - +#[starknet::interface] +pub trait IXERC20 { + fn mint(ref self: TState, user: u256, amount: u256); + fn burn(ref self: TState, user: u256, amount: u256); + fn set_limits(ref self: TState, bridge: u256, minting_limit: u256, burning_limit: u256); + fn owner(self: @TState) -> u256; + fn burning_current_limit_of(self: @TState, bridge: u256) -> u256; + fn minting_current_limit_of(self: @TState, bridge: u256) -> u256; + fn minting_max_limit_of(self: @TState, minter: u256) -> u256; + fn burning_max_limit_of(self: @TState, bridge: u256) -> u256; +} diff --git a/cairo/src/contracts/token/interfaces/ixerc20_lockbox.cairo b/cairo/src/contracts/token/interfaces/ixerc20_lockbox.cairo index 8b13789..7b88e1e 100644 --- a/cairo/src/contracts/token/interfaces/ixerc20_lockbox.cairo +++ b/cairo/src/contracts/token/interfaces/ixerc20_lockbox.cairo @@ -1 +1,10 @@ - +#[starknet::interface] +pub trait IXERC20Lockbox { + fn xerc20(self: @TState) -> u256; + fn erc20(self: @TState) -> u256; + fn deposit(ref self: TState, amount: u256); + fn deposit_to(ref self: TState, user: u256, amount: u256); + fn deposit_native_to(ref self: TState, user: u256); + fn withdraw(ref self: TState, amount: u256); + fn withdraw_to(ref self: TState, user: u256, amount: u256); +}