diff --git a/docs/primitives/dao.md b/docs/primitives/dao.md index 8cae4b09bac..38a9511fc8c 100644 --- a/docs/primitives/dao.md +++ b/docs/primitives/dao.md @@ -55,6 +55,7 @@ easily generalizable to other DAO implementations. ## Create a DAO The simplest way to create and interact with a DAO is to go through the [AstraDAO UI](https://near.social/astraplusplus.ndctools.near/widget/home?page=daos). +### Using Sputnik DAO Contract You can also create a DAO by interacting with the `sputnik-dao` contract. @@ -74,6 +75,52 @@ You can also create a DAO by interacting with the `sputnik-dao` contract.
+### Using Global Contract + +You can find out what global contracts are [here](../smart-contracts/global-contracts.md). But in short, global contracts allow smart contracts to be deployed once and reused by any account without incurring high storage costs. + +In other words, you can deploy a DAO contract using our global DAO contract, which is already deployed and basically is just [a Sputnik DAO contract](https://github.com/near-daos/sputnik-dao-contract/tree/main/sputnikdao2) without any customization. You need only to call the following deploying command with your initialization parameters. + + + + Deploy by account id: + + ```bash + near contract deploy use-global-account-id dao.globals.primitives.testnet \ + with-init-call new \ + json-args '{"config": {"name": "Primitives", "purpose": "Building primitives on NEAR", "metadata":""}, "policy": [""]}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain \ + send + ``` + + + Deploy by hash: + + ```bash + near contract deploy use-global-hash Ea8tHXFSQVszVwGASyzAfLq65DjcRDhkfab4FcPaRpgD \ + with-init-call new \ + json-args '{"config": {"name": "Primitives", "purpose": "Building primitives on NEAR", "metadata":""}, "policy": [""]}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain \ + send + ``` + + + + +:::note +The difference between global contracts deployed by account id and by hash is that the former is updatable, while the latter is immutable. When it's deployed by account id, the owner can redeploy the contract updating it for all its users. + +So when you decide which option to use for deploying your DAO contract, you should consider whether you want to it to be updatable by its original owner or not. +::: + +
+ ### Voting policy Currently, DAOs support two different types of [voting policies](https://github.com/near-daos/sputnik-dao-contract#voting-policy): `TokenWeight`, and `RoleWeight`. diff --git a/docs/primitives/ft.md b/docs/primitives/ft.md index 00b2ba56ad0..4671dd52423 100644 --- a/docs/primitives/ft.md +++ b/docs/primitives/ft.md @@ -48,7 +48,15 @@ In order for a contract to be considered a FT-contract it has to follow the [**N --- -## Token Factory Tool +## Create New Token + +There are three ways to create a fungible token (FT) on NEAR: + +1. Using the **[Token Factory Tool](#token-factory-tool)**, a tool to create a FT contract through graphical interface, or by making calls to its contract. +2. **Deploying [your own FT Contract](#deploying-your-own-contract)**: Writing and deploying your own FT contract from scratch. +3. **Deploying a token [using Global Contract](#deploying-a-token-using-global-contract)**: Writing and deploying your own FT contract from scratch. + +### Token Factory Tool You can create an FT using the toolbox on [Dev Portal](https://dev.near.org/tools). The FT Tool is a token factory, you can interact with it through graphical interface, or by making calls to its contract. @@ -65,9 +73,9 @@ You can create an FT using the toolbox on [Dev Portal](https://dev.near.org/tool The FT you create will live in the account `.tkn.primitives.near` (e.g. `test.tkn.primitives.near`). ---- +
-## Deploying Your Own Contract +### Deploying Your Own Contract You can also create a fungible token by deploying and initializing a [canonical FT contract](https://github.com/near-examples/FT). @@ -89,6 +97,50 @@ To initialize a FT contract you will need to deploy it and then call the `new` m Check the [Contract Wizard](https://dev.near.org/contractwizard.near/widget/ContractWizardUI) to create a personalized FT contract!. ::: +
+ +### Deploying a Token Using Global Contract + +You can find out what global contracts are [here](../smart-contracts/global-contracts.md). But in short, global contracts allow smart contracts to be deployed once and reused by any account without incurring high storage costs. + +In other words, you can deploy a FT contract using our global FT contract, which is already deployed and basically is just [a standard FT contract](https://github.com/near-examples/FT) without any customization. You need only to call the following deploying command with your initialization parameters. + + + + Deploy by account id: + + ```bash + near contract deploy use-global-account-id ft.globals.primitives.testnet \ + with-init-call \ + new_default_meta \ + json-args '{"owner_id": "", "total_supply": "100000000000000000000000000000"}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain send + ``` + + Deploy by hash: + + ```bash + near contract deploy use-global-hash 3vaopJ7aRoivvzZLngPQRBEd8VJr2zPLTxQfnRCoFgNX \ + with-init-call \ + new_default_meta \ + json-args '{"owner_id": "", "total_supply": "100000000000000000000000000000"}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain send + ``` + + + +:::note +The difference between global contracts deployed by account id and by hash is that the former is updatable, while the latter is immutable. When it's deployed by account id, the owner can redeploy the contract updating it for all its users. + +So when you decide which option to use for deploying your FT contract, you should consider whether you want to it to be updatable by its original owner or not. +::: + --- ## Querying Metadata diff --git a/docs/primitives/nft.md b/docs/primitives/nft.md index 614bfaa3bc4..464d0017165 100644 --- a/docs/primitives/nft.md +++ b/docs/primitives/nft.md @@ -66,7 +66,10 @@ The easiest way to create and handle NFTs is by using one of the existing commun --- ## Deploying a NFT Contract -If you want to deploy your own NFT contract, you can create one using our [reference implementation](https://github.com/near-examples/NFT) + +### Deploying Your Own Contract + +If you want to deploy your own NFT contract, you can create one using our [reference implementation](https://github.com/near-examples/NFT). Simply personalize it and deploy it to your account. @@ -89,6 +92,51 @@ Check the [Contract Wizard](https://dev.near.org/contractwizard.near/widget/Cont ::: +
+ +### Deploying Using Global Contract + +You can find out what global contracts are [here](../smart-contracts/global-contracts.md). But in short, global contracts allow smart contracts to be deployed once and reused by any account without incurring high storage costs. + +In other words, you can deploy a NFT contract using our global NFT contract, which is already deployed and basically is just [a standard NFT contract](https://github.com/near-examples/NFT) without any customization. You need only to call the following deploying command with your initialization parameters. + + + + Deploy by account id: + + ```bash + near contract deploy use-global-account-id nft.globals.primitives.testnet \ + with-init-call new \ + json-args '{"owner_id": "", "metadata": {"spec": "nft-1.0.0", "name": "MY_NFT", "symbol": "NFT2000", "icon": "data:image/svg+xml,%3Csvg xmlns='\''http://www.w3.org/2000/svg'\'' viewBox='\''0 0 288 288'\''%3E%3Cg id='\''l'\'' data-name='\''l'\''%3E%3Cpath d='\''M187.58,79.81l-30.1,44.69a3.2,3.2,0,0,0,4.75,4.2L191.86,103a1.2,1.2,0,0,1,2,.91v80.46a1.2,1.2,0,0,1-2.12.77L102.18,77.93A15.35,15.35,0,0,0,90.47,72.5H87.34A15.34,15.34,0,0,0,72,87.84V201.16A15.34,15.34,0,0,0,87.34,216.5h0a15.35,15.35,0,0,0,13.08-7.31l30.1-44.69a3.2,3.2,0,0,0-4.75-4.2L96.14,186a1.2,1.2,0,0,1-2-.91V104.61a1.2,1.2,0,0,1,2.12-.77l89.55,107.23a15.35,15.35,0,0,0,11.71,5.43h3.13A15.34,15.34,0,0,0,216,201.16V87.84A15.34,15.34,0,0,0,200.66,72.5h0A15.35,15.35,0,0,0,187.58,79.81Z'\''/%3E%3C/g%3E%3C/svg%3E"}}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain \ + send + ``` + + Deploy by hash: + + ```bash + near contract deploy use-global-hash ivu1e9obVRnMJLSvVPRgtYefUYUS1L3f5eYHjS86zL9 \ + with-init-call new \ + json-args '{"owner_id": "", "metadata": {"spec": "nft-1.0.0", "name": "MY_NFT", "symbol": "NFT2000", "icon": "data:image/svg+xml,%3Csvg xmlns='\''http://www.w3.org/2000/svg'\'' viewBox='\''0 0 288 288'\''%3E%3Cg id='\''l'\'' data-name='\''l'\''%3E%3Cpath d='\''M187.58,79.81l-30.1,44.69a3.2,3.2,0,0,0,4.75,4.2L191.86,103a1.2,1.2,0,0,1,2,.91v80.46a1.2,1.2,0,0,1-2.12.77L102.18,77.93A15.35,15.35,0,0,0,90.47,72.5H87.34A15.34,15.34,0,0,0,72,87.84V201.16A15.34,15.34,0,0,0,87.34,216.5h0a15.35,15.35,0,0,0,13.08-7.31l30.1-44.69a3.2,3.2,0,0,0-4.75-4.2L96.14,186a1.2,1.2,0,0,1-2-.91V104.61a1.2,1.2,0,0,1,2.12-.77l89.55,107.23a15.35,15.35,0,0,0,11.71,5.43h3.13A15.34,15.34,0,0,0,216,201.16V87.84A15.34,15.34,0,0,0,200.66,72.5h0A15.35,15.35,0,0,0,187.58,79.81Z'\''/%3E%3C/g%3E%3C/svg%3E"}}' \ + prepaid-gas '100.0 Tgas' \ + attached-deposit '0 NEAR' \ + network-config testnet \ + sign-with-keychain \ + send + ``` + + + + +:::note +The difference between global contracts deployed by account id and by hash is that the former is updatable, while the latter is immutable. When it's deployed by account id, the owner can redeploy the contract updating it for all its users. + +So when you decide which option to use for deploying your NFT contract, you should consider whether you want to it to be updatable by its original owner or not. +::: + --- ## Minting a NFT