Skip to content

Commit

Permalink
ref: apply CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bidzyyys committed May 15, 2024
1 parent bf93ebc commit b803cc1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions contracts/src/erc721/extensions/uri_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ use alloy_sol_types::sol;
use stylus_proc::{external, sol_storage};
use stylus_sdk::evm;

sol_storage! {
/// Uri Storage.
pub struct ERC721UriStorage {
/// Optional mapping for token URIs.
mapping(uint256 => string) _token_uris;
}
}

sol! {
/// This event gets emitted when the metadata of a token is changed.
///
Expand All @@ -30,6 +22,14 @@ sol! {
event BatchMetadataUpdate(uint256 from_token_id, uint256 to_token_id);
}

sol_storage! {
/// Uri Storage.
pub struct ERC721UriStorage {
/// Optional mapping for token URIs.
mapping(uint256 => string) _token_uris;
}
}

#[external]
impl ERC721UriStorage {
/// Returns the Uniform Resource Identifier (URI) for `token_id` token.
Expand All @@ -49,7 +49,7 @@ impl ERC721UriStorage {
///
/// * `&mut self` - Write access to the contract's state.
/// * `token_id` - Id of a token.
/// * `token_uri` - .
/// * `token_uri` - URI for the token.
///
/// # Events
/// Emits a [`MetadataUpdate`] event.
Expand Down Expand Up @@ -78,7 +78,7 @@ mod tests {

fn random_token_id() -> U256 {
let num: u32 = rand::random();
num.try_into().expect("conversion to U256")
U256::from(num)
}

#[grip::test]
Expand Down

0 comments on commit b803cc1

Please sign in to comment.