Skip to content

Commit

Permalink
feat: add migration function
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal committed Apr 23, 2024
1 parent 21026f6 commit 5ae7faf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ repository = "https://github.com/starknet-id/identity"

[dependencies]
starknet = "2.6.3"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", rev = "a83f36b23f1af6e160288962be4a2701c3ecbcda" }
storage_read = { git = "https://github.com/starknet-id/storage_read_component.git", rev = "c7a640371d0336cc09b907154cbfeec743739ff9" }
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", rev = "0697004db74502ce49900edef37331dd03531356" }
storage_read = { git = "https://github.com/starknet-id/storage_read_component.git", rev = "6440184cc078188d1efeab1283d1698738cde435" }

[[target.starknet-contract]]
sierra = true
Expand Down
5 changes: 5 additions & 0 deletions src/identity/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,10 @@ mod Identity {
)
);
}

fn migrate(ref self: ContractState, token_uri: ByteArray) {
self.ownable.assert_only_owner();
self.erc721.initializer("Starknet.id", "ID", token_uri);
}
}
}
4 changes: 4 additions & 0 deletions src/interface/identity.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ trait IIdentity<TContractState> {
fn set_extended_verifier_data(
ref self: TContractState, id: u128, field: felt252, data: Span<felt252>, domain: u32
);

fn migrate(
ref self: TContractState, token_uri: ByteArray
);
}

0 comments on commit 5ae7faf

Please sign in to comment.