This project is an implementation of ERC-721 using Hedera Consensus service.
- The main application which handles HCS messages and updates the state of the contract
- A database layer that keeps track of token transactions/functions
- An api to access information about the contract
- Unit testing
- Examples in Swift and Typescript
Assets that are not identical and inherently replaceable are non-fungible. Examples of fungible assets include units of currency or a copy of your favorite movie. These each have the same value and are interchangeable with other units/copies of the same item.
Non-fungible assets are ones that are unique and have attributes that make them difficult to swap or replace. Examples of non-fungible assets are unique artwork or unique collectibles. These can still be exchanged, but the value between exchanges may or may not be equal.
NFTs, then, are tokens that are inherently unique, distinguishable, and not easily replaceable/exchangeable with another NFT.
ERC-721 is the defacto, and most widely adopted standard for NFTs. ERC-721 includes functions that allow for transferring tokens between accounts, getting account balances, getting the owner of a specific token and the total supply of tokens available on the network, and approving that an amount of tokens can be moved from one account by a third party account.
-
Clone the project
-
Create the database with PostgreSQL
createdb -h 127.0.0.1 -U postgres seven_twenty_one
- Initiate migrations
./gradlew flywayMigrate
-
Create a personal .env file. A sample is provided here
-
Build the application
./gradlew build
- Run the application
java -jar contract/build/libs/contract.jar
Refer to: Examples
/
{
"baseURI": "",
"name": "Fire",
"owner": "302a300506032b6570032100ed44bebe19f73aefb65e1dcd80c429483eb8cebd63ddd6da3950725b5d8315d2",
"symbol": "XFR",
"totalSupply": 0
}
/token/31
{
"owner": "302a300506032b6570032100ed44bebe19f73aefb65e1dcd80c429483eb8cebd63ddd6da3950725b5d8315d2",
"approved": null
}
/account/{address}
{
"balance": 2,
"tokens": [
"5",
"382932"
]
}
/transaction
/account/{address}/transaction
{
"transactions": [
{
"caller": "ed44bebe19f73aefb65e1dcd80c429483eb8cebd63ddd6da3950725b5d8315d2",
"consensusAt": "2020-12-01T13:48:34.430118Z",
"data": {
"baseURI": "",
"tokenName": "Fire",
"tokenSymbol": "XFR"
},
"function": "constructor",
"status": "OK"
}
]
}
/transaction/{address}/{valid-start}
{
"caller": "ed44bebe19f73aefb65e1dcd80c429483eb8cebd63ddd6da3950725b5d8315d2",
"consensusAt": "2020-12-01T13:48:34.430118Z",
"data": {
"baseURI": "",
"tokenName": "Fire",
"tokenSymbol": "XFR"
},
"function": "constructor",
"status": "OK"
}
/transaction/{address}/{valid-start}/receipt
{
"id":"2370/1607614667206066176",
"caller":"302a300506032b6570032100d788efa7be5b3c25e52cbb62846181307e5a83872e03ed5ffb6739859f13c600",
"consensusAt":"2020-12-10T15:39:05.859711004Z",
"status":"OK"
}