TrueNFT enables B2B Messages to be tokenized either through EDI or XML Mappings and Data Ingestion
-
Deploy the NFT and Master Proxy contracts
-
Deploy the Universal Proxy contract with the Master Proxy’s address and an admin address (this should be a human account) as input
-
Deploy the Controller contract with the Universal Proxy’s address and an admin address (the same address as in step 2) an input
-
Call
changeControllerthrough the Universal Proxy from the admin address. The controller should be changed to the controller address deployed in step
Steps 1-3 cannot be performed through the API. Step 4 can if the
controller_address is originally set to equal the universal_address.
This solution is not ideal, so all of the steps 1-4 should be completed
during the server setup.
These smart contracts will need to be updated for gas efficiency and to verify their security in the upcoming weeks.
The basic smart contract implementation is a functional set of smart contracts that will meet the implementation needs of any company using EDI X12/EDIFACT.
-
The continuous integration for github is a script that will run the postman and truffle tests on new commits added to the github repository.
-
The truffle tests are a set of javascript unit tests that will verify the modular properties of the codebase to ensure that it always meets the intention of the smart contract architecture. They are designed to have near-complete code coverage and thus should prevent most bugs.
-
The postman api unit tests are a set of tests for each api endpoint that verify that the endpoints will reject on invalid inputs and return the right data types.
In combination with the truffle tests, the postman tests will verify the integrity of the whole codebase.
The javascript endpoint implementation of the endpoints extends the test endpoints from last week. Now, in addition to data sanitation and returning proper values, they will parse the input data, format transactions and make ethereum calls through the infura web3. The new endpoints will also properly validate Corporate signatures of the nonce which protects admin transactions.
SEE API
SEE DEPLOYMENTS
| Development | Dates |
|---|---|
GraphQL |
2020 Q4 |
Gas Optimizations |
2020 Q4 |
Composability |
2020 Q4 |
API reference for the Freight Trust dApp which allows recording, transfering and signing of EDI-based documents such as bills of lading or warehouse receipts.
GET /getNonce
Returns the current message Freight Trust needs to sign to verify their next post request
| Code | Message | Datatype |
|---|---|---|
200 |
Successful query |
|
428 |
Request Timeout |
<<>> |
POST /nft/approve/
Change or reaffirm the approved address for an NFT
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Approve |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/balanceOf/
Count all NFTs assigned to an owner
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/createRecord/
Creates a new record
Allows Freight Trust to create a record with the signature of the owner and of the participant.
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Creation |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/getApproved/
Get the approved address for a single NFT
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/isApprovedForAll/
Query if an address is an authorized operator for another address
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/name
Returns the token contract’s name
| Code | Message | Datatype |
|---|---|---|
200 |
Successful query |
|
428 |
Request Timeout |
<<>> |
GET /nft/ownerOf/
Find the owner of an NFT
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/safeTransferFrom/
Transfers the ownership of an NFT from one address to another address
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Transfer |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/setApprovalForAll/
Allows Freight Trust to issue univeral approval
Enable or disable approval for a third party (operator) to manage all of Freight Trust’s assets
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Approve |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/signedTransfer/
Signed Transfer
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Transfer |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/supportsInterface/
Returns an interface’s support status
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/symbol
Returns the token contract’s symbol
| Code | Message | Datatype |
|---|---|---|
200 |
Successful query |
|
428 |
Request Timeout |
<<>> |
GET /nft/tokenByIndex/
Returns the token identifier of the index-th nft tracked by the contract
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/tokenOfOwnerByIndex/
Returns the token identifier of the index-th nft assigned to the owner
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/tokenURI/
Enumerate NFTs assigned to an owner
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Query |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
GET /nft/totalSupply
An API endpoint to get the total supply of tokens in the ERC721 contract
| Code | Message | Datatype |
|---|---|---|
200 |
Successful query |
|
428 |
Request Timeout |
<<>> |
POST /nft/transferFrom/
Transfer ownership of an NFT without safety checks
Allows Freight Trust to tranfer tokens unsafely —
THE CALLER IS RESPONSIBLE TO CONFIRM THAT IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Transfer |
|
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/versionRecord/
Versions a record for Freight Trust
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust nonce signature to verify this action Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Edit |
<<>> |
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /nft/versionRecord/signed/
Versions a record for the owner
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successful Editing |
<<>> |
420 |
Bad Request |
<<>> |
428 |
Request Timeout |
<<>> |
POST /proxy/changeController/
Sets the the new controller address
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successfuly Changed |
|
425 |
Invalid Input |
<<>> |
POST /proxy/changeMaster/
Sets the address of Function
Sets address that is delegate called to run a function’s logic. This function must be called with an signed nonce from the Freight Trust account in the https body.
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successfuly Changed |
|
425 |
Invalid Input |
<<>> |
GET /proxy/getControler
Gets address of the controler Contract
| Code | Message | Datatype |
|---|---|---|
200 |
successful operation |
GET /proxy/getMaster
Gets address of the Master Contract
| Code | Message | Datatype |
|---|---|---|
200 |
successful operation |
GET /proxy/getTarget/
Gets address of Function
| Code | Message | Datatype |
|---|---|---|
200 |
successful operation |
|
425 |
Invalid Input |
<<>> |
GET /proxy/getUniversalProxy
Gets address of the Universal Proxy Contract
| Code | Message | Datatype |
|---|---|---|
200 |
successful operation |
POST /proxy/pause
Pauses the execution
Calls the pause method in the universal proxy, blocking any state changes while Freight Trust’s Network Operations Group updates.
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successfuly Paused |
|
425 |
Invalid Input |
<<>> |
POST /proxy/setTarget/
Sets the address of Function
Sets address that is delegate called to run a function’s logic. This function must be called with an signed nonce from the Freight Trust account in the https body.
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
auth |
The Freight Trust signature of the nonce Auth |
X |
| Code | Message | Datatype |
|---|---|---|
200 |
Successfuly Changed |
|
425 |
Invalid Input |
<<>> |
| Field Name | Required | Type | Description | Format |
|---|---|---|---|---|
code |
Integer |
int32 |
||
type |
String |
|||
message |
String |
| Field Name | Required | Type | Description | Format |
|---|---|---|---|---|
freightTrustAuth |
auth |
|||
ownerAuth |
auth |
|||
partAuth |
auth |
Copyright 2020 © FreightTrust and Clearing Corporation All Rights Reserved - https://freighttrust.com
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/