Comments (2)
@peersky: Wanted to put in writing what we discussed verbally in earlier meeting.
ID fields
Better for ID fields to have no semantic connection with the data they describe. If we used the hashing scheme that you were initially considering, for example, it could cause problems if we migrated from a contract at one address to another. This is just one reason to not put semantic information in ID.
There are situations in which we might want to put semantic information in primary key, but at this point it would bring more headaches than we need.
Simple data model
Better to make a simple, composable data model for now and we can add additional functionality (like KYC) later. Invariably, if we put too much stuff in the data model compared to the functionality we want to offer on day 1, most of it will become obsolete as soon as we release. Even worse, it might become an obstacle to rapid development of the data model when we do want to make the correct changes.
I suggest we create the following types of resources:
Customer
Contains the following information
id
- primary key we use to refer to customer in DBname
- name of customernotes
- human-readable/writeable notes about customer
This data should only be visible to Terminus admins (anyone who has appropriate token on the Moonstream Terminus contract).
Contract
Contains the following information:
id
- primary key we use to refer to contract in DBblockchain
- chain which Terminus contract is deployedaddress
- address of the contract on that blockchaincustomer_id
- foreign key toCustomer.id
controller
- address of Terminus controllername
- human friendly name for contractnotes
- human friendly notes about contract
customer_id
only visible to admins
name
, notes
only visible to admins and Terminus controller
Pool
Contains the following information:
id
- primary keycontract_id
- foreign key toContract.id
pool_number
- ID of pool on Terminus contract (uint256
)capacity
- capacity of poolis_transferable
- true/false depending on whether pool is transferableis_burnable
- true/false depending on whether pool is burnablepool_controller
- address of pool controllername
- human friendly name for poolnotes
- notes about pool
name
, notes
only visible to admins and Terminus controller
PoolAuthorization
Contains the following information:
id
- primary keypool_id
- foreign key intoPool.id
address
- authorized address for pool
PoolOwner
Contains the following information:
id
- primary keypool_id
- foreign key intoPool.id
address
- address of token ownernum_tokens
- number of tokens they own
AddressAnnotation
Contains the following information:
address
annotator
- address of account that created annotationname
- name for addressnotes
- notes for address
Each resource is only visible to its annotator
.
from dao.
Better for ID fields to have no semantic connection with the data they describe. If we used the hashing scheme that you were initially considering, for example, it could cause problems if we migrated from a contract at one address to another. This is just one reason to not put semantic information in ID.
@zomglings
I like idea with Contract
objects. I think we should treat Contract
as blockchain specific object, not a Diamond
/Terminus
specific.
Assuming Contract
is blockchain property - such hashing scheme would just represent blockchain state more precise: Contract.address
is immutable property in it's blockchain nature.
This semantic connection would allow to avoid potential bugs that might occur if there occurs mismatch of env
in frontend and address stored in Contract.address
(failed migration, did not update field correctly, wrong branch etc).
I have feeling that the more we work with blockchain, the more it will make sense for us to use such scheme.
My concern is here that Im not aware how this can impact performance of db, I want to run benchmark after implementation to compare db access speed for approach when we hash on frontend and access by hash and selected for now approach when we do
- ListResources matching criteria
- Access resource[0] of ^^^
from dao.
Related Issues (20)
- Tokenomics [milestone]
- DAO whitepaper [milestone]
- Need to add `name` and `symbol` to terminus token HOT 3
- Terminus `non transferable` token could be transferred using `safeBatchTransferFrom`
- `isApprovedForPool` problems and Proposal to replace it.
- Make it easier to allow others to create the pool
- Allow pool creators to set pools as "revocable"
- Add cli for generate json output for opensea and add on parameters of cli cutch if pool token is transferable or mintable.
- Create new terminus pools with URI and controller as arguments
- Multisig functions to submit txs with terminus tokne holders' signatures
- Add ERC721 support to TokenDrainerFacet
- More tests for TerminusController
- Burning terminus token doesn't respect `isApprovedForAll`
- Make a doc that explains devs need to implement `IERC1155Holder`
- addd `burnBatch` to terminus
- hardhat support HOT 1
- "TerminusControllerFacet.initTerminusController" should only be callable by contract owner
- Estimate deployment and operation costs for Terminus on Ethereum mainnet
- Add `burnAll` to Terminus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dao.