diff --git a/src/interfaces.cairo b/src/interfaces.cairo index 8ac959f..056973f 100644 --- a/src/interfaces.cairo +++ b/src/interfaces.cairo @@ -5,3 +5,4 @@ pub mod IProfile; pub mod IFollowNFT; pub mod IPublication; pub mod IHandle; +pub mod IHandleRegistry; diff --git a/src/namespaces/handle_registry.cairo b/src/namespaces/handle_registry.cairo index 54de0f6..c6f12c5 100644 --- a/src/namespaces/handle_registry.cairo +++ b/src/namespaces/handle_registry.cairo @@ -24,8 +24,8 @@ mod HandleRegistry { #[event] #[derive(Drop, starknet::Event)] enum Event { - Linked: Linked, - Unlinked: Unlinked, + Linked: HandleLinked, + Unlinked: HandleUnlinked, } #[derive(Drop, starknet::Event)] @@ -48,7 +48,9 @@ mod HandleRegistry { // CONSTRUCTOR // ************************************************************************* #[constructor] - fn constructor(hub_address: ContractAddress, handle_address: ContractAddress) { + fn constructor( + ref self: ContractState, hub_address: ContractAddress, handle_address: ContractAddress + ) { self.hub_address.write(hub_address); self.handle_address.write(handle_address); } @@ -70,21 +72,33 @@ mod HandleRegistry { // ************************************************************************* // GETTERS // ************************************************************************* - fn resolve(self: @ContractState, handle_id: u256) -> ContractAddress {// TODO + fn resolve(self: @ContractState, handle_id: u256) -> ContractAddress { + // TODO + 0.try_into().unwrap() } - fn get_handle(self: @ContractState, profile_address: ContractAddress) -> u256 {// TODO + fn get_handle(self: @ContractState, profile_address: ContractAddress) -> u256 { + // TODO + 0.try_into().unwrap() } } // ************************************************************************* // PRIVATE FUNCTIONS - // ************************************************************************* + // ************************************************************************* + #[generate_trait] impl Private of PrivateTrait { - fn _link(ref self: ContractState, handle_id: u256, profile_address: ContractAddress) {// TODO + fn _link( + ref self: ContractState, handle_id: u256, profile_address: ContractAddress + ) { // TODO } - fn _unlink(ref self: ContractState, handle_id: u256, profile_address: ContractAddress) {// TODO + fn _unlink( + ref self: ContractState, + handle_id: u256, + profile_address: ContractAddress, + caller: ContractAddress + ) { // TODO } } } diff --git a/src/publication/publication.cairo b/src/publication/publication.cairo index e9d766e..05edae9 100644 --- a/src/publication/publication.cairo +++ b/src/publication/publication.cairo @@ -168,9 +168,9 @@ pub mod Publications { // logic here 0 } - ////////////////////////////////////////////////////////////// - /// GETTERS////////////////////////////////////////////////// - /// ///////////////////////////////////////////////////////// + // ************************************************************************* + // GETTERS + // ************************************************************************* fn get_publication_content_uri( self: @ContractState, profile_address: ContractAddress, pub_id: u256 ) -> ByteArray {