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
Hi there! I just pushed this: https://github.com/Creit-Tech/sorobandomains-sc/commit/ac335564b000a463359e5d76b2c05f1e9581b041
It's a new contract that works with the Registry contract and it has this interface:
pub trait KeyValueDBTrait {
fn set_config(
e: Env,
adm: Address,
registry: Address,
fee: u128,
currency: Address,
treasury: Address,
);
fn upgrade(e: Env, hash: BytesN<32>);
fn set(e: Env, node: BytesN<32>, key: Symbol, value: Value);
fn get(e: Env, node: BytesN<32>, key: Symbol) -> Option<Value>;
fn remove(e: Env, node: BytesN<32>, key: Symbol);
}
It follows the similar interface LocalStorage has in Javascript which basically allows you to set, get and remove a value from the storage. When setting a new value, the contract will fetch and request authorization from the domain owner (also when removing a key), as a protection it also checks the snapshot value of the domain when getting the value, this way it prevents contracts getting a value from a domain that recently changed its owner.
I haven't tested it yet, basically I just deployed it to testnet and add one value. By being a key-value storage, basically every project can define their own Keys but it will be good if we come with some pre-defined keys to use
The testnet contract is: CDS6WQMDH6RTPFFWLPK3TPVBIH5TNMKUCNPXHZTDV2YYVHXPIAQEUXAX and you can see one example of the data saved here: https://stellar.expert/explorer/testnet/contract/CDS6WQMDH6RTPFFWLPK3TPVBIH5TNMKUCNPXHZTDV2YYVHXPIAQEUXAX/storage
let me know what you think
The text was updated successfully, but these errors were encountered:
I have deployed the Key-Value contract to mainnet: https://stellar.expert/explorer/public/contract/CDH2T2CBGFPFNVRWFK4XJIRP6VOWSVTSDCRBCJ2TEIO22GADQP6RG3Y6
The contract follows the same logic from the one on testnet with the only difference that: the fee is paid in PSD instead of XLM.
Btw I also added the stellar.expert deployment flow so the contract code is shown on stellar.expert
https://stellar.expert/explorer/public/contract/CDH2T2CBGFPFNVRWFK4XJIRP6VOWSVTSDCRBCJ2TEIO22GADQP6RG3Y6
I would like to propose a few keys as a standard:
## SEP-1 TOML file url
TOML = Value::String(TOML_URL)
## Optional, could help in verifying the content hasn't been tempered
TOML_HASH = Value::Bytes(TOML_SHA256_HASH)
## Projects like xlm.sh could use this key, that way they don't need to look for the CID elsewhere
WEBSITE_IPFS = Value::Bytes(IPFS_CID)
We are discussing with Soroban Domains (Enrique) to add link metadata to a domain. See this discussion:
https://discord.com/channels/897514728459468821/1213642853339766805/1293795340515934230
The text was updated successfully, but these errors were encountered: