This is a novel ERC721 contract that wraps Tableland to provide novel functionality: a key value store.
It achieves this by allowing anyone to "mint" a new key value store. That store is a table on Tableland. The owner is allowed to update the table and grant permissions to other addresses to update. The scope of what they can do with the table (insert, update, delete key values) is defined by the smart contract. New KV are represented as novel NFTs owned by the original creator.
Contract running on Polygon Mumbai: https://mumbai.polygonscan.com/address/0x81A0f6fDdD81f8dEed49316C3f040718aF2c9202#writeProxyContract
Use the safeMint
function. address
should be your wallet address. name
is a custom name for your kv store.
Use the runSQL
method to send full SQL statements.
Or, use the addKeyValue
method and updateValue
methods to insert and update key values.
Use the grant
method to grant write access to any KV store to a new address. You can now instantly collaborate on the same KV store.
You can connect directly to this contract with the SDK and CLI by specifying the contract address. That will allow you to create new KV stores or update values from your code easily.
Contract collection on Opensea testnets: https://testnets.opensea.io/collection/wedis-h4v5lmgwc9
You must have a .env
file with the following information
PRIVATE_KEY={your wallet key with a balance of matic}
POLYGONSCAN_API_KEY={your polyscan api key for pushing the abi}
POLYGON_MUMBAI_API_KEY={your alchemy api key for mumbai}
REPORT_GAS=true
npm install
npm run tableland
npm run local
or upgrade npm run localup
npm run deploy
This example is not maintained.