You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
If you want To use Starknet Name Services for contracts you can follow this steps:
1)Contract Deployment:
Deploy your Starknet contract on the Starknet network.
2)Starknet Name Registration:
Once your contract is deployed, you can register a name for it using Starknet Name Services. This involves calling the relevant functions in the SNS contract.
3)Interact with the Named Contract:
After registration, you and others can interact with your contract using the human-readable name instead of the contract address.
Here's a simplified example assuming there's a Starknet Name Services contract deployed:
solidity
Copy code
// Starknet Name Services contract example (simplified)
contract StarknetNameServices {
mapping(string => address) public nameToAddress;
function registerName(string memory name, address contractAddress) public {
// Check if the name is not already registered
require(nameToAddress[name] == address(0), "Name already registered");
// Register the name with the contract address
nameToAddress[name] = contractAddress;
}
function getAddress(string memory name) public view returns (address) {
// Get the contract address associated with the name
return nameToAddress[name];
}
}
In this example:
registerName allows you to register a name for a contract.
getAddress allows you to retrieve the contract address associated with a name.
After deploying this Starknet Name Services contract, you can interact with it to register names for your contracts and later retrieve the contract addresses.
Hope to be helpful ;)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you want To use Starknet Name Services for contracts you can follow this steps:
1)Contract Deployment:
Deploy your Starknet contract on the Starknet network.
2)Starknet Name Registration:
Once your contract is deployed, you can register a name for it using Starknet Name Services. This involves calling the relevant functions in the SNS contract.
3)Interact with the Named Contract:
After registration, you and others can interact with your contract using the human-readable name instead of the contract address.
Here's a simplified example assuming there's a Starknet Name Services contract deployed:
solidity
Copy code
// Starknet Name Services contract example (simplified)
contract StarknetNameServices {
mapping(string => address) public nameToAddress;
}
In this example:
registerName allows you to register a name for a contract.
getAddress allows you to retrieve the contract address associated with a name.
After deploying this Starknet Name Services contract, you can interact with it to register names for your contracts and later retrieve the contract addresses.
Hope to be helpful ;)
The text was updated successfully, but these errors were encountered: