Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit 7963168

Browse files
Merge pull request #15 from projectNEWM/v0.2.2
Candidate for v0.2.2
2 parents b40b1de + 06693de commit 7963168

File tree

114 files changed

+3933
-1884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3933
-1884
lines changed

.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# network magic. either --testnet-magic # or --mainnet
2+
network="--mainnet"
3+
4+
#path to cardano-cli
5+
cli="cardano-cli"
6+
7+
#path to cardano-hw-cli
8+
hwcli="cardano-hw-cli"
9+
10+
#path to a node socket
11+
socket="/home/westbam/haskell/local/db/socket"
12+
13+
export CARDANO_NODE_SOCKET_PATH=$socket
14+
15+
# get params
16+
mkdir -p tmp
17+
${cli} query protocol-parameters ${network} --out-file tmp/protocol.json

.env.mainnet

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# network magic. either --testnet-magic # or --mainnet
2+
network="--mainnet"
3+
4+
#path to cardano-cli
5+
cli="cardano-cli"
6+
7+
#path to cardano-hw-cli
8+
hwcli="cardano-hw-cli"
9+
10+
#path to a node socket
11+
socket="/home/westbam/haskell/local/db/socket"
12+
13+
export CARDANO_NODE_SOCKET_PATH=$socket
14+
15+
# get params
16+
mkdir -p tmp
17+
${cli} query protocol-parameters ${network} --out-file tmp/protocol.json

.env.preprod

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# network magic. either --testnet-magic # or --mainnet
2+
network="--testnet-magic 1"
3+
4+
#path to cardano-cli
5+
cli="cardano-cli"
6+
7+
#path to cardano-hw-cli
8+
hwcli="cardano-hw-cli"
9+
10+
#path to a node socket
11+
socket="/home/westbam/haskell/pprod/db/socket"
12+
13+
export CARDANO_NODE_SOCKET_PATH=$socket
14+
15+
# get params
16+
mkdir -p tmp
17+
${cli} query protocol-parameters ${network} --out-file tmp/protocol.json

.env.preview

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# network magic. either --testnet-magic # or --mainnet
2+
network="--testnet-magic 2"
3+
4+
#path to cardano-cli
5+
cli="cardano-cli"
6+
7+
#path to cardano-hw-cli
8+
hwcli="cardano-hw-cli"
9+
10+
#path to a node socket
11+
socket="/home/westbam/haskell/prev/db/socket"
12+
13+
export CARDANO_NODE_SOCKET_PATH=$socket
14+
15+
# get params
16+
mkdir -p tmp
17+
${cli} query protocol-parameters ${network} --out-file tmp/protocol.json

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ result*
2525
.envrc
2626
.vim
2727
scripts/wallet
28-
status.json
28+
status.json
29+
__pycache__
30+
tmp
31+
*.metadata.json

README.md

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,31 @@
1-
# Project Newm Contracts
1+
# Project NEWM
22

3-
A collection of contracts used my Project Newm.
3+
A collection of smart contracts for Project NEWM.
44

5-
# E2E Testing
5+
# v0.2.x
66

7-
The initial testing will assume Newm holds a special wallet that will regulate all token minting. In the future, this will be expanded into more decentralized solutions.
7+
The v0.2.x contract versions assume NEWM holds a special wallet that will regulate token minting and burning. In the future, this centralized signing mechanism will be replaced with a decentralized solution.
88

9-
The example in the repo is with test wallets. A recompile with proper wallets will need to occur during the initial production phase.
9+
### useful-funcs
1010

11-
## Flow
12-
13-
An artist comes to Newm wishing to tokenize an piece of art then fractionalize the tokenization. First, Newm will create the initial tokenized version of the art by minting a token on the official Newm catalog policy id. An artist may keep the original tokenized version of their art or they may fractionalize the original token.
14-
15-
The fractionalization of a token is the splitting of the ownership rights of the original tokenized art into 100 million pieces. The original tokenized art is locked into a smart contract and the resulting fractions are given to the artist. From here the artist my do what they wish with the fractions.
11+
A library for useful functions for inside the contracts.
1612

17-
This entire process is reversible. At any point, an artist my obtain the original tokenized by burning the 100 million fractional tokens.
13+
https://github.com/logicalmechanism/useful-funcs
1814

19-
## Tokenization
20-
21-
Each UTxO inside the tokenization contract is a unique Newm catalog, completely determined by the token prefix name like "Newm_", "paintings_", or "songs_". The contract behaves as a sequential NFT generator, minting tokens using the concatentation of the prefix with the current token counter. The sequence of NFTs will continue forever or at least until the size of the token name exceeds 32 characters.
15+
## Flow
2216

23-
### Process
17+
An artist comes to NEWM wishing to tokenize a piece of art, digitalizing a real-world object onto the blockchain. The artist may decide to split the ownership rights of the tokenized object by fractionalization, splitting a tokeninzed object into 100,000,000 fractions. First, NEWM will create the initial tokenized object by minting an NFT on the official NEWM catalog policy id. At this point, the artist may keep the original tokenized version of their art or they may fractionalize the original NFT into a fungible token.
2418

25-
- Create catalog UTxO inside the tokenization contract.
26-
- Mint sequential NFT for artist.
27-
- (Optional) If required, any catalog NFT may be burned.
28-
- (Optional) If required, any catalog may be removed.
19+
The fractionalization of a token is the splitting of the ownership rights of the original tokenized art into 100 million pieces. The original tokenized art is locked into a smart contract and the resulting fractions are given to the artist. From here the artist may do as they wish with their fractions.
2920

30-
** Each prefix and thus each UTxO must be unique.
21+
This entire process is reversible. At any point, an artist may obtain the original tokenized object by burning the 100 million fractional tokens.
3122

32-
### Example
23+
## Tokenization
3324

34-
```bash
35-
./createCatalogUTxO.sh
36-
./MintNFT.sh
25+
Each UTxO inside the tokenization contract is a unique NEWM catalog, holding a unique datum with a token prefix like "NEWM_", "paintings_", or "songs_" and the current NFT counter. The contract behaves as a sequential NFT generator, minting tokens using the concatenation of the prefix with the current token counter. The sequence of NFTs will continue forever or at least until the size of the token name exceeds 32 characters. The resulting NFTs will have a token name like "NEWM_0" or "NEWM_414".
3726

38-
# if required
39-
./burnNFT.sh
40-
./removedCatalogUTxO.sh
41-
```
4227
## Fractionalization
4328

44-
Each fractionalization of a token must be prepped by Newm or the artist. This ensures that only one token may be added onto an existing UTxO for fractionalization. There is no way to do entry validation for smart contracts on Cardano. Validation only occurs during a spending event thus forcing the artist or Newm to update an already existing UTxO means forcing on-chain validation. The fractionalized tokens will have the fractional Newm policy id but will share the same name as the original token. The token to be fractionalize may only be unlocked if and only if all 100 million fractions are burned together at once.
45-
46-
### Process
47-
48-
- Create fractional UTxO.
49-
- Lock and mint token fractions.
50-
- (Optional) If required, fractional tokens may be burned to unlock the original token.
51-
- (Optional) If required, the left over fractional UTxO may be removed after successful burning.
52-
53-
** Fractionalization of tokens if the same names will result in two sets of fractions.
54-
55-
### Example
29+
Each UTxO inside the fractionalization contract is a unique fractionalization of a NEWM NFT. The fractionalized tokens will have the fractional NEWM policy id but will share the same name as the original tokenized object. The minting of the fractions will only occur if the original NEWM NFT is sent into the fractional contract to be locked. This means the fractionalized UTxO may only be unlocked if all 100 million fractions are burned together in a single transaction.
5630

57-
```bash
58-
./createFractionalUTxO.sh
59-
./lockAndFractionalize.sh
6031

61-
# if required
62-
./unlockAndSolidify.sh
63-
./removeFractionalUTxO.sh
64-
```

0 commit comments

Comments
 (0)