Skip to content

Commit

Permalink
fix on missing trait exposed
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Sep 1, 2024
1 parent 40f2c5a commit 7969ebe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cairo/src/contracts/token/hyp_erc721.cairo
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
use alexandria_bytes::Bytes;
use starknet::ContractAddress;

#[starknet::interface]
pub trait IHypErc721<TState> {
fn initialize(ref self: TState);
fn balance_of(self: @TState) -> u256;
fn handle(ref self: TState, origin: u32, sender: ContractAddress, message: Bytes);
}

#[starknet::contract]
pub mod HypErc721 {
use alexandria_bytes::Bytes;
use hyperlane_starknet::contracts::client::gas_router_component::GasRouterComponent;
use hyperlane_starknet::contracts::client::mailboxclient_component::MailboxclientComponent;
use hyperlane_starknet::contracts::client::router_component::RouterComponent;
use hyperlane_starknet::contracts::token::components::hyp_erc721_component::HypErc721Component;
use hyperlane_starknet::contracts::token::components::token_router::TokenRouterComponent;
use hyperlane_starknet::contracts::token::interfaces::imessage_recipient::IMessageRecipient;
use openzeppelin::access::ownable::OwnableComponent;
use openzeppelin::introspection::src5::SRC5Component;
use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
Expand Down Expand Up @@ -106,6 +112,16 @@ pub mod HypErc721 {
self.token_router.initialize(mailbox);
}

#[abi(embed_v0)]
impl MessageRecipient of IMessageRecipient<ContractState> {
fn handle(
ref self: ContractState, origin: u32, sender: Option<ContractAddress>, message: Bytes
) {
self.token_router._handle(origin, message)
}
}


#[abi(embed_v0)]
impl HypErc721Upgradeable of IUpgradeable<ContractState> {
fn upgrade(ref self: ContractState, new_class_hash: starknet::ClassHash) {
Expand Down

0 comments on commit 7969ebe

Please sign in to comment.