@tradetrust-yl/token-registry 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +446 -0
  3. package/dist/artifacts/TitleEscrow.sol/TitleEscrow.json +823 -0
  4. package/dist/artifacts/TitleEscrowFactory.sol/TitleEscrowFactory.json +123 -0
  5. package/dist/artifacts/TradeTrustToken.sol/TradeTrustToken.json +778 -0
  6. package/dist/artifacts/base/RegistryAccess.sol/RegistryAccess.dbg.json +4 -0
  7. package/dist/artifacts/base/RegistryAccess.sol/RegistryAccess.json +321 -0
  8. package/dist/artifacts/base/SBTUpgradeable.sol/SBTUpgradeable.dbg.json +4 -0
  9. package/dist/artifacts/base/SBTUpgradeable.sol/SBTUpgradeable.json +202 -0
  10. package/dist/artifacts/base/TradeTrustSBT.sol/TradeTrustSBT.dbg.json +4 -0
  11. package/dist/artifacts/base/TradeTrustSBT.sol/TradeTrustSBT.json +374 -0
  12. package/dist/artifacts/base/TradeTrustTokenBase.sol/TradeTrustTokenBase.dbg.json +4 -0
  13. package/dist/artifacts/base/TradeTrustTokenBase.sol/TradeTrustTokenBase.json +757 -0
  14. package/dist/artifacts/base/TradeTrustTokenBaseURI.sol/TradeTrustTokenBaseURI.dbg.json +4 -0
  15. package/dist/artifacts/base/TradeTrustTokenBaseURI.sol/TradeTrustTokenBaseURI.json +655 -0
  16. package/dist/artifacts/base/TradeTrustTokenBurnable.sol/TradeTrustTokenBurnable.dbg.json +4 -0
  17. package/dist/artifacts/base/TradeTrustTokenBurnable.sol/TradeTrustTokenBurnable.json +660 -0
  18. package/dist/artifacts/base/TradeTrustTokenMintable.sol/TradeTrustTokenMintable.dbg.json +4 -0
  19. package/dist/artifacts/base/TradeTrustTokenMintable.sol/TradeTrustTokenMintable.json +676 -0
  20. package/dist/artifacts/base/TradeTrustTokenRestorable.sol/TradeTrustTokenRestorable.dbg.json +4 -0
  21. package/dist/artifacts/base/TradeTrustTokenRestorable.sol/TradeTrustTokenRestorable.json +666 -0
  22. package/dist/artifacts/interfaces/IERC721MetadataUpgradeable.sol/IERC721MetadataUpgradeable.dbg.json +4 -0
  23. package/dist/artifacts/interfaces/IERC721MetadataUpgradeable.sol/IERC721MetadataUpgradeable.json +166 -0
  24. package/dist/artifacts/interfaces/ISBTUpgradeable.sol/ISBTUpgradeable.dbg.json +4 -0
  25. package/dist/artifacts/interfaces/ISBTUpgradeable.sol/ISBTUpgradeable.json +121 -0
  26. package/dist/artifacts/interfaces/ITitleEscrow.sol/ITitleEscrow.dbg.json +4 -0
  27. package/dist/artifacts/interfaces/ITitleEscrow.sol/ITitleEscrow.json +637 -0
  28. package/dist/artifacts/interfaces/ITitleEscrowFactory.sol/ITitleEscrowFactory.dbg.json +4 -0
  29. package/dist/artifacts/interfaces/ITitleEscrowFactory.sol/ITitleEscrowFactory.json +92 -0
  30. package/dist/artifacts/interfaces/ITitleEscrowSignable.sol/ITitleEscrowSignable.dbg.json +4 -0
  31. package/dist/artifacts/interfaces/ITitleEscrowSignable.sol/ITitleEscrowSignable.json +784 -0
  32. package/dist/artifacts/interfaces/ITradeTrustSBT.sol/ITradeTrustSBT.dbg.json +4 -0
  33. package/dist/artifacts/interfaces/ITradeTrustSBT.sol/ITradeTrustSBT.json +219 -0
  34. package/dist/artifacts/interfaces/ITradeTrustToken.sol/ITradeTrustToken.dbg.json +4 -0
  35. package/dist/artifacts/interfaces/ITradeTrustToken.sol/ITradeTrustToken.json +295 -0
  36. package/dist/artifacts/interfaces/ITradeTrustTokenBurnable.sol/ITradeTrustTokenBurnable.dbg.json +4 -0
  37. package/dist/artifacts/interfaces/ITradeTrustTokenBurnable.sol/ITradeTrustTokenBurnable.json +29 -0
  38. package/dist/artifacts/interfaces/ITradeTrustTokenMintable.sol/ITradeTrustTokenMintable.dbg.json +4 -0
  39. package/dist/artifacts/interfaces/ITradeTrustTokenMintable.sol/ITradeTrustTokenMintable.json +45 -0
  40. package/dist/artifacts/interfaces/ITradeTrustTokenRestorable.sol/ITradeTrustTokenRestorable.dbg.json +4 -0
  41. package/dist/artifacts/interfaces/ITradeTrustTokenRestorable.sol/ITradeTrustTokenRestorable.json +35 -0
  42. package/dist/artifacts/interfaces/RegistryAccessErrors.sol/RegistryAccessErrors.dbg.json +4 -0
  43. package/dist/artifacts/interfaces/RegistryAccessErrors.sol/RegistryAccessErrors.json +16 -0
  44. package/dist/artifacts/interfaces/SigHelperErrors.sol/SigHelperErrors.dbg.json +4 -0
  45. package/dist/artifacts/interfaces/SigHelperErrors.sol/SigHelperErrors.json +16 -0
  46. package/dist/artifacts/interfaces/TDocDeployerErrors.sol/TDocDeployerErrors.dbg.json +4 -0
  47. package/dist/artifacts/interfaces/TDocDeployerErrors.sol/TDocDeployerErrors.json +37 -0
  48. package/dist/artifacts/interfaces/TitleEscrowErrors.sol/TitleEscrowErrors.dbg.json +4 -0
  49. package/dist/artifacts/interfaces/TitleEscrowErrors.sol/TitleEscrowErrors.json +119 -0
  50. package/dist/artifacts/interfaces/TitleEscrowFactoryErrors.sol/TitleEscrowFactoryErrors.dbg.json +4 -0
  51. package/dist/artifacts/interfaces/TitleEscrowFactoryErrors.sol/TitleEscrowFactoryErrors.json +16 -0
  52. package/dist/artifacts/interfaces/TitleEscrowSignableErrors.sol/TitleEscrowSignableErrors.dbg.json +4 -0
  53. package/dist/artifacts/interfaces/TitleEscrowSignableErrors.sol/TitleEscrowSignableErrors.json +69 -0
  54. package/dist/artifacts/interfaces/TradeTrustTokenErrors.sol/TradeTrustTokenErrors.dbg.json +4 -0
  55. package/dist/artifacts/interfaces/TradeTrustTokenErrors.sol/TradeTrustTokenErrors.json +36 -0
  56. package/dist/artifacts/mocks/ERC721ReceiverMock.sol/ERC721ReceiverMock.dbg.json +4 -0
  57. package/dist/artifacts/mocks/ERC721ReceiverMock.sol/ERC721ReceiverMock.json +101 -0
  58. package/dist/artifacts/mocks/SBTUpgradeableMock.sol/SBTUpgradeableMock.dbg.json +4 -0
  59. package/dist/artifacts/mocks/SBTUpgradeableMock.sol/SBTUpgradeableMock.json +304 -0
  60. package/dist/artifacts/mocks/SigHelperMock.sol/SigHelperMock.dbg.json +4 -0
  61. package/dist/artifacts/mocks/SigHelperMock.sol/SigHelperMock.json +182 -0
  62. package/dist/artifacts/mocks/SimpleCaller.sol/SimpleCaller.dbg.json +4 -0
  63. package/dist/artifacts/mocks/SimpleCaller.sol/SimpleCaller.json +35 -0
  64. package/dist/artifacts/mocks/TitleEscrowFactoryCallerMock.sol/TitleEscrowFactoryCallerMock.dbg.json +4 -0
  65. package/dist/artifacts/mocks/TitleEscrowFactoryCallerMock.sol/TitleEscrowFactoryCallerMock.json +29 -0
  66. package/dist/artifacts/mocks/TitleEscrowFactoryGetterMock.sol/TitleEscrowFactoryGetterMock.dbg.json +4 -0
  67. package/dist/artifacts/mocks/TitleEscrowFactoryGetterMock.sol/TitleEscrowFactoryGetterMock.json +66 -0
  68. package/dist/artifacts/mocks/TitleEscrowMock.sol/TitleEscrowMock.dbg.json +4 -0
  69. package/dist/artifacts/mocks/TitleEscrowMock.sol/TitleEscrowMock.json +869 -0
  70. package/dist/artifacts/mocks/TradeTrustTokenMock.sol/TradeTrustTokenMock.dbg.json +4 -0
  71. package/dist/artifacts/mocks/TradeTrustTokenMock.sol/TradeTrustTokenMock.json +815 -0
  72. package/dist/artifacts/presets/TitleEscrowSignable.sol/TitleEscrowSignable.dbg.json +4 -0
  73. package/dist/artifacts/presets/TitleEscrowSignable.sol/TitleEscrowSignable.json +1132 -0
  74. package/dist/artifacts/presets/TradeTrustTokenStandard.sol/TradeTrustTokenStandard.dbg.json +4 -0
  75. package/dist/artifacts/presets/TradeTrustTokenStandard.sol/TradeTrustTokenStandard.json +775 -0
  76. package/dist/artifacts/utils/SigHelper.sol/SigHelper.dbg.json +4 -0
  77. package/dist/artifacts/utils/SigHelper.sol/SigHelper.json +67 -0
  78. package/dist/artifacts/utils/TDocDeployer.sol/TDocDeployer.dbg.json +4 -0
  79. package/dist/artifacts/utils/TDocDeployer.sol/TDocDeployer.json +402 -0
  80. package/dist/constants/contract-address.js +56 -0
  81. package/dist/constants/contract-interface-id.js +18 -0
  82. package/dist/constants/contract-interfaces.js +17 -0
  83. package/dist/constants/default-address.js +19 -0
  84. package/dist/constants/index.js +49 -0
  85. package/dist/constants/role-hash.js +24 -0
  86. package/dist/contracts/@openzeppelin/contracts/access/IAccessControl.js +13 -0
  87. package/dist/contracts/@openzeppelin/contracts/access/IAccessControl.ts +293 -0
  88. package/dist/contracts/@openzeppelin/contracts/access/index.js +5 -0
  89. package/dist/contracts/@openzeppelin/contracts/access/index.ts +5 -0
  90. package/dist/contracts/@openzeppelin/contracts/index.js +5 -0
  91. package/dist/contracts/@openzeppelin/contracts/index.ts +14 -0
  92. package/dist/contracts/@openzeppelin/contracts/interfaces/IERC1967.js +13 -0
  93. package/dist/contracts/@openzeppelin/contracts/interfaces/IERC1967.ts +169 -0
  94. package/dist/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.js +5 -0
  95. package/dist/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.ts +91 -0
  96. package/dist/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.js +5 -0
  97. package/dist/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +5 -0
  98. package/dist/contracts/@openzeppelin/contracts/interfaces/index.js +5 -0
  99. package/dist/contracts/@openzeppelin/contracts/interfaces/index.ts +7 -0
  100. package/dist/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.js +5 -0
  101. package/dist/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.ts +70 -0
  102. package/dist/contracts/@openzeppelin/contracts/proxy/ERC1967/index.js +5 -0
  103. package/dist/contracts/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
  104. package/dist/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.js +5 -0
  105. package/dist/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.ts +91 -0
  106. package/dist/contracts/@openzeppelin/contracts/proxy/beacon/index.js +5 -0
  107. package/dist/contracts/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
  108. package/dist/contracts/@openzeppelin/contracts/proxy/index.js +5 -0
  109. package/dist/contracts/@openzeppelin/contracts/proxy/index.ts +10 -0
  110. package/dist/contracts/@openzeppelin/contracts/proxy/utils/Initializable.js +11 -0
  111. package/dist/contracts/@openzeppelin/contracts/proxy/utils/Initializable.ts +106 -0
  112. package/dist/contracts/@openzeppelin/contracts/proxy/utils/index.js +5 -0
  113. package/dist/contracts/@openzeppelin/contracts/proxy/utils/index.ts +5 -0
  114. package/dist/contracts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.js +5 -0
  115. package/dist/contracts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.ts +111 -0
  116. package/dist/contracts/@openzeppelin/contracts/token/ERC721/index.js +5 -0
  117. package/dist/contracts/@openzeppelin/contracts/token/ERC721/index.ts +5 -0
  118. package/dist/contracts/@openzeppelin/contracts/token/index.js +5 -0
  119. package/dist/contracts/@openzeppelin/contracts/token/index.ts +6 -0
  120. package/dist/contracts/@openzeppelin/contracts/utils/Address.js +5 -0
  121. package/dist/contracts/@openzeppelin/contracts/utils/Address.ts +70 -0
  122. package/dist/contracts/@openzeppelin/contracts/utils/Errors.js +5 -0
  123. package/dist/contracts/@openzeppelin/contracts/utils/Errors.ts +70 -0
  124. package/dist/contracts/@openzeppelin/contracts/utils/Pausable.js +12 -0
  125. package/dist/contracts/@openzeppelin/contracts/utils/Pausable.ts +151 -0
  126. package/dist/contracts/@openzeppelin/contracts/utils/Strings.js +5 -0
  127. package/dist/contracts/@openzeppelin/contracts/utils/Strings.ts +70 -0
  128. package/dist/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.js +5 -0
  129. package/dist/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.ts +70 -0
  130. package/dist/contracts/@openzeppelin/contracts/utils/cryptography/index.js +5 -0
  131. package/dist/contracts/@openzeppelin/contracts/utils/cryptography/index.ts +5 -0
  132. package/dist/contracts/@openzeppelin/contracts/utils/index.js +5 -0
  133. package/dist/contracts/@openzeppelin/contracts/utils/index.ts +14 -0
  134. package/dist/contracts/@openzeppelin/contracts/utils/introspection/IERC165.js +5 -0
  135. package/dist/contracts/@openzeppelin/contracts/utils/introspection/IERC165.ts +95 -0
  136. package/dist/contracts/@openzeppelin/contracts/utils/introspection/index.js +5 -0
  137. package/dist/contracts/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
  138. package/dist/contracts/@openzeppelin/contracts/utils/math/SafeCast.js +5 -0
  139. package/dist/contracts/@openzeppelin/contracts/utils/math/SafeCast.ts +70 -0
  140. package/dist/contracts/@openzeppelin/contracts/utils/math/index.js +5 -0
  141. package/dist/contracts/@openzeppelin/contracts/utils/math/index.ts +5 -0
  142. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.js +14 -0
  143. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.ts +360 -0
  144. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.js +12 -0
  145. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.ts +187 -0
  146. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/index.js +5 -0
  147. package/dist/contracts/@openzeppelin/contracts-upgradeable/access/index.ts +6 -0
  148. package/dist/contracts/@openzeppelin/contracts-upgradeable/index.js +5 -0
  149. package/dist/contracts/@openzeppelin/contracts-upgradeable/index.ts +10 -0
  150. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/index.js +5 -0
  151. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/index.ts +6 -0
  152. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.js +11 -0
  153. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.ts +106 -0
  154. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.js +12 -0
  155. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.ts +197 -0
  156. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/index.js +5 -0
  157. package/dist/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/index.ts +6 -0
  158. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.js +11 -0
  159. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.ts +106 -0
  160. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.js +13 -0
  161. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.ts +184 -0
  162. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/index.js +5 -0
  163. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/index.ts +8 -0
  164. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.js +11 -0
  165. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.ts +131 -0
  166. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/index.js +5 -0
  167. package/dist/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/index.ts +5 -0
  168. package/dist/contracts/@openzeppelin/index.js +5 -0
  169. package/dist/contracts/@openzeppelin/index.ts +8 -0
  170. package/dist/contracts/common.js +5 -0
  171. package/dist/contracts/common.ts +132 -0
  172. package/dist/contracts/contracts/TitleEscrow.js +20 -0
  173. package/dist/contracts/contracts/TitleEscrow.ts +874 -0
  174. package/dist/contracts/contracts/TitleEscrowFactory.js +11 -0
  175. package/dist/contracts/contracts/TitleEscrowFactory.ts +171 -0
  176. package/dist/contracts/contracts/TradeTrustToken.js +19 -0
  177. package/dist/contracts/contracts/TradeTrustToken.ts +819 -0
  178. package/dist/contracts/contracts/base/RegistryAccess.js +14 -0
  179. package/dist/contracts/contracts/base/RegistryAccess.ts +424 -0
  180. package/dist/contracts/contracts/base/SBTUpgradeable.js +12 -0
  181. package/dist/contracts/contracts/base/SBTUpgradeable.ts +260 -0
  182. package/dist/contracts/contracts/base/TradeTrustSBT.js +16 -0
  183. package/dist/contracts/contracts/base/TradeTrustSBT.ts +442 -0
  184. package/dist/contracts/contracts/base/TradeTrustTokenBase.js +19 -0
  185. package/dist/contracts/contracts/base/TradeTrustTokenBase.ts +819 -0
  186. package/dist/contracts/contracts/base/TradeTrustTokenBaseURI.js +19 -0
  187. package/dist/contracts/contracts/base/TradeTrustTokenBaseURI.ts +736 -0
  188. package/dist/contracts/contracts/base/TradeTrustTokenBurnable.js +19 -0
  189. package/dist/contracts/contracts/base/TradeTrustTokenBurnable.ts +747 -0
  190. package/dist/contracts/contracts/base/TradeTrustTokenMintable.js +19 -0
  191. package/dist/contracts/contracts/base/TradeTrustTokenMintable.ts +757 -0
  192. package/dist/contracts/contracts/base/TradeTrustTokenRestorable.js +19 -0
  193. package/dist/contracts/contracts/base/TradeTrustTokenRestorable.ts +747 -0
  194. package/dist/contracts/contracts/base/index.js +5 -0
  195. package/dist/contracts/contracts/base/index.ts +12 -0
  196. package/dist/contracts/contracts/index.js +5 -0
  197. package/dist/contracts/contracts/index.ts +17 -0
  198. package/dist/contracts/contracts/interfaces/IERC721MetadataUpgradeable.js +11 -0
  199. package/dist/contracts/contracts/interfaces/IERC721MetadataUpgradeable.ts +222 -0
  200. package/dist/contracts/contracts/interfaces/ISBTUpgradeable.js +11 -0
  201. package/dist/contracts/contracts/interfaces/ISBTUpgradeable.ts +195 -0
  202. package/dist/contracts/contracts/interfaces/ITitleEscrow.js +19 -0
  203. package/dist/contracts/contracts/interfaces/ITitleEscrow.ts +798 -0
  204. package/dist/contracts/contracts/interfaces/ITitleEscrowFactory.js +11 -0
  205. package/dist/contracts/contracts/interfaces/ITitleEscrowFactory.ts +171 -0
  206. package/dist/contracts/contracts/interfaces/ITitleEscrowSignable.js +20 -0
  207. package/dist/contracts/contracts/interfaces/ITitleEscrowSignable.ts +923 -0
  208. package/dist/contracts/contracts/interfaces/ITradeTrustSBT.js +13 -0
  209. package/dist/contracts/contracts/interfaces/ITradeTrustSBT.ts +313 -0
  210. package/dist/contracts/contracts/interfaces/ITradeTrustToken.js +13 -0
  211. package/dist/contracts/contracts/interfaces/ITradeTrustToken.ts +380 -0
  212. package/dist/contracts/contracts/interfaces/ITradeTrustTokenBurnable.js +5 -0
  213. package/dist/contracts/contracts/interfaces/ITradeTrustTokenBurnable.ts +97 -0
  214. package/dist/contracts/contracts/interfaces/ITradeTrustTokenMintable.js +5 -0
  215. package/dist/contracts/contracts/interfaces/ITradeTrustTokenMintable.ts +108 -0
  216. package/dist/contracts/contracts/interfaces/ITradeTrustTokenRestorable.js +5 -0
  217. package/dist/contracts/contracts/interfaces/ITradeTrustTokenRestorable.ts +97 -0
  218. package/dist/contracts/contracts/interfaces/RegistryAccessErrors.js +5 -0
  219. package/dist/contracts/contracts/interfaces/RegistryAccessErrors.ts +70 -0
  220. package/dist/contracts/contracts/interfaces/SigHelperErrors.js +5 -0
  221. package/dist/contracts/contracts/interfaces/SigHelperErrors.ts +70 -0
  222. package/dist/contracts/contracts/interfaces/TDocDeployerErrors.js +5 -0
  223. package/dist/contracts/contracts/interfaces/TDocDeployerErrors.ts +70 -0
  224. package/dist/contracts/contracts/interfaces/TitleEscrowErrors.js +5 -0
  225. package/dist/contracts/contracts/interfaces/TitleEscrowErrors.ts +70 -0
  226. package/dist/contracts/contracts/interfaces/TitleEscrowFactoryErrors.js +5 -0
  227. package/dist/contracts/contracts/interfaces/TitleEscrowFactoryErrors.ts +70 -0
  228. package/dist/contracts/contracts/interfaces/TitleEscrowSignableErrors.js +5 -0
  229. package/dist/contracts/contracts/interfaces/TitleEscrowSignableErrors.ts +70 -0
  230. package/dist/contracts/contracts/interfaces/TradeTrustTokenErrors.js +5 -0
  231. package/dist/contracts/contracts/interfaces/TradeTrustTokenErrors.ts +70 -0
  232. package/dist/contracts/contracts/interfaces/index.js +5 -0
  233. package/dist/contracts/contracts/interfaces/index.ts +21 -0
  234. package/dist/contracts/contracts/mocks/ERC721ReceiverMock.js +11 -0
  235. package/dist/contracts/contracts/mocks/ERC721ReceiverMock.ts +184 -0
  236. package/dist/contracts/contracts/mocks/SBTUpgradeableMock.js +12 -0
  237. package/dist/contracts/contracts/mocks/SBTUpgradeableMock.ts +344 -0
  238. package/dist/contracts/contracts/mocks/SigHelperMock.js +5 -0
  239. package/dist/contracts/contracts/mocks/SigHelperMock.ts +183 -0
  240. package/dist/contracts/contracts/mocks/SimpleCaller.js +5 -0
  241. package/dist/contracts/contracts/mocks/SimpleCaller.ts +100 -0
  242. package/dist/contracts/contracts/mocks/TitleEscrowFactoryCallerMock.js +5 -0
  243. package/dist/contracts/contracts/mocks/TitleEscrowFactoryCallerMock.ts +98 -0
  244. package/dist/contracts/contracts/mocks/TitleEscrowFactoryGetterMock.js +5 -0
  245. package/dist/contracts/contracts/mocks/TitleEscrowFactoryGetterMock.ts +139 -0
  246. package/dist/contracts/contracts/mocks/TitleEscrowMock.js +20 -0
  247. package/dist/contracts/contracts/mocks/TitleEscrowMock.ts +916 -0
  248. package/dist/contracts/contracts/mocks/TradeTrustTokenMock.js +19 -0
  249. package/dist/contracts/contracts/mocks/TradeTrustTokenMock.ts +859 -0
  250. package/dist/contracts/contracts/mocks/index.js +5 -0
  251. package/dist/contracts/contracts/mocks/index.ts +12 -0
  252. package/dist/contracts/contracts/presets/TitleEscrowSignable.js +21 -0
  253. package/dist/contracts/contracts/presets/TitleEscrowSignable.ts +1054 -0
  254. package/dist/contracts/contracts/presets/TradeTrustTokenStandard.js +19 -0
  255. package/dist/contracts/contracts/presets/TradeTrustTokenStandard.ts +830 -0
  256. package/dist/contracts/contracts/presets/index.js +5 -0
  257. package/dist/contracts/contracts/presets/index.ts +6 -0
  258. package/dist/contracts/contracts/utils/SigHelper.js +5 -0
  259. package/dist/contracts/contracts/utils/SigHelper.ts +111 -0
  260. package/dist/contracts/contracts/utils/TDocDeployer.js +15 -0
  261. package/dist/contracts/contracts/utils/TDocDeployer.ts +442 -0
  262. package/dist/contracts/contracts/utils/index.js +5 -0
  263. package/dist/contracts/contracts/utils/index.ts +6 -0
  264. package/dist/contracts/factories/@openzeppelin/contracts/access/IAccessControl__factory.js +169 -0
  265. package/dist/contracts/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +219 -0
  266. package/dist/contracts/factories/@openzeppelin/contracts/access/index.js +12 -0
  267. package/dist/contracts/factories/@openzeppelin/contracts/access/index.ts +5 -0
  268. package/dist/contracts/factories/@openzeppelin/contracts/index.js +18 -0
  269. package/dist/contracts/factories/@openzeppelin/contracts/index.ts +9 -0
  270. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/IERC1967__factory.js +54 -0
  271. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/IERC1967__factory.ts +68 -0
  272. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.js +29 -0
  273. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.ts +39 -0
  274. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.js +12 -0
  275. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +5 -0
  276. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/index.js +17 -0
  277. package/dist/contracts/factories/@openzeppelin/contracts/interfaces/index.ts +6 -0
  278. package/dist/contracts/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils__factory.js +66 -0
  279. package/dist/contracts/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils__factory.ts +106 -0
  280. package/dist/contracts/factories/@openzeppelin/contracts/proxy/ERC1967/index.js +12 -0
  281. package/dist/contracts/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
  282. package/dist/contracts/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.js +29 -0
  283. package/dist/contracts/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.ts +36 -0
  284. package/dist/contracts/factories/@openzeppelin/contracts/proxy/beacon/index.js +12 -0
  285. package/dist/contracts/factories/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
  286. package/dist/contracts/factories/@openzeppelin/contracts/proxy/index.js +14 -0
  287. package/dist/contracts/factories/@openzeppelin/contracts/proxy/index.ts +7 -0
  288. package/dist/contracts/factories/@openzeppelin/contracts/proxy/utils/Initializable__factory.js +37 -0
  289. package/dist/contracts/factories/@openzeppelin/contracts/proxy/utils/Initializable__factory.ts +49 -0
  290. package/dist/contracts/factories/@openzeppelin/contracts/proxy/utils/index.js +12 -0
  291. package/dist/contracts/factories/@openzeppelin/contracts/proxy/utils/index.ts +5 -0
  292. package/dist/contracts/factories/@openzeppelin/contracts/token/ERC721/IERC721Receiver__factory.js +45 -0
  293. package/dist/contracts/factories/@openzeppelin/contracts/token/ERC721/IERC721Receiver__factory.ts +60 -0
  294. package/dist/contracts/factories/@openzeppelin/contracts/token/ERC721/index.js +12 -0
  295. package/dist/contracts/factories/@openzeppelin/contracts/token/ERC721/index.ts +5 -0
  296. package/dist/contracts/factories/@openzeppelin/contracts/token/index.js +10 -0
  297. package/dist/contracts/factories/@openzeppelin/contracts/token/index.ts +5 -0
  298. package/dist/contracts/factories/@openzeppelin/contracts/utils/Address__factory.js +46 -0
  299. package/dist/contracts/factories/@openzeppelin/contracts/utils/Address__factory.ts +76 -0
  300. package/dist/contracts/factories/@openzeppelin/contracts/utils/Errors__factory.js +66 -0
  301. package/dist/contracts/factories/@openzeppelin/contracts/utils/Errors__factory.ts +102 -0
  302. package/dist/contracts/factories/@openzeppelin/contracts/utils/Pausable__factory.js +57 -0
  303. package/dist/contracts/factories/@openzeppelin/contracts/utils/Pausable__factory.ts +72 -0
  304. package/dist/contracts/factories/@openzeppelin/contracts/utils/Strings__factory.js +50 -0
  305. package/dist/contracts/factories/@openzeppelin/contracts/utils/Strings__factory.ts +81 -0
  306. package/dist/contracts/factories/@openzeppelin/contracts/utils/cryptography/ECDSA__factory.js +58 -0
  307. package/dist/contracts/factories/@openzeppelin/contracts/utils/cryptography/ECDSA__factory.ts +92 -0
  308. package/dist/contracts/factories/@openzeppelin/contracts/utils/cryptography/index.js +12 -0
  309. package/dist/contracts/factories/@openzeppelin/contracts/utils/cryptography/index.ts +5 -0
  310. package/dist/contracts/factories/@openzeppelin/contracts/utils/index.js +42 -0
  311. package/dist/contracts/factories/@openzeppelin/contracts/utils/index.ts +11 -0
  312. package/dist/contracts/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.js +33 -0
  313. package/dist/contracts/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.ts +42 -0
  314. package/dist/contracts/factories/@openzeppelin/contracts/utils/introspection/index.js +12 -0
  315. package/dist/contracts/factories/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
  316. package/dist/contracts/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.js +78 -0
  317. package/dist/contracts/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.ts +119 -0
  318. package/dist/contracts/factories/@openzeppelin/contracts/utils/math/index.js +12 -0
  319. package/dist/contracts/factories/@openzeppelin/contracts/utils/math/index.ts +5 -0
  320. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable__factory.js +211 -0
  321. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable__factory.ts +278 -0
  322. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.js +94 -0
  323. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.ts +123 -0
  324. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/index.js +19 -0
  325. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/access/index.ts +6 -0
  326. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/index.js +14 -0
  327. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/index.ts +7 -0
  328. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/index.js +10 -0
  329. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/index.ts +5 -0
  330. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.js +37 -0
  331. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.ts +49 -0
  332. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable__factory.js +117 -0
  333. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable__factory.ts +154 -0
  334. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/index.js +19 -0
  335. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/proxy/utils/index.ts +6 -0
  336. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable__factory.js +37 -0
  337. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable__factory.ts +49 -0
  338. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable__factory.js +75 -0
  339. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable__factory.ts +102 -0
  340. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/index.js +24 -0
  341. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/index.ts +7 -0
  342. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable__factory.js +51 -0
  343. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable__factory.ts +68 -0
  344. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/introspection/index.js +12 -0
  345. package/dist/contracts/factories/@openzeppelin/contracts-upgradeable/utils/introspection/index.ts +5 -0
  346. package/dist/contracts/factories/@openzeppelin/index.js +12 -0
  347. package/dist/contracts/factories/@openzeppelin/index.ts +6 -0
  348. package/dist/contracts/factories/contracts/TitleEscrowFactory__factory.js +124 -0
  349. package/dist/contracts/factories/contracts/TitleEscrowFactory__factory.ts +180 -0
  350. package/dist/contracts/factories/contracts/TitleEscrow__factory.js +678 -0
  351. package/dist/contracts/factories/contracts/TitleEscrow__factory.ts +877 -0
  352. package/dist/contracts/factories/contracts/TradeTrustToken__factory.js +630 -0
  353. package/dist/contracts/factories/contracts/TradeTrustToken__factory.ts +858 -0
  354. package/dist/contracts/factories/contracts/base/RegistryAccess__factory.js +259 -0
  355. package/dist/contracts/factories/contracts/base/RegistryAccess__factory.ts +336 -0
  356. package/dist/contracts/factories/contracts/base/SBTUpgradeable__factory.js +184 -0
  357. package/dist/contracts/factories/contracts/base/SBTUpgradeable__factory.ts +259 -0
  358. package/dist/contracts/factories/contracts/base/TradeTrustSBT__factory.js +299 -0
  359. package/dist/contracts/factories/contracts/base/TradeTrustSBT__factory.ts +389 -0
  360. package/dist/contracts/factories/contracts/base/TradeTrustTokenBaseURI__factory.js +517 -0
  361. package/dist/contracts/factories/contracts/base/TradeTrustTokenBaseURI__factory.ts +674 -0
  362. package/dist/contracts/factories/contracts/base/TradeTrustTokenBase__factory.js +595 -0
  363. package/dist/contracts/factories/contracts/base/TradeTrustTokenBase__factory.ts +776 -0
  364. package/dist/contracts/factories/contracts/base/TradeTrustTokenBurnable__factory.js +521 -0
  365. package/dist/contracts/factories/contracts/base/TradeTrustTokenBurnable__factory.ts +679 -0
  366. package/dist/contracts/factories/contracts/base/TradeTrustTokenMintable__factory.js +533 -0
  367. package/dist/contracts/factories/contracts/base/TradeTrustTokenMintable__factory.ts +695 -0
  368. package/dist/contracts/factories/contracts/base/TradeTrustTokenRestorable__factory.js +525 -0
  369. package/dist/contracts/factories/contracts/base/TradeTrustTokenRestorable__factory.ts +685 -0
  370. package/dist/contracts/factories/contracts/base/index.js +61 -0
  371. package/dist/contracts/factories/contracts/base/index.ts +12 -0
  372. package/dist/contracts/factories/contracts/index.js +39 -0
  373. package/dist/contracts/factories/contracts/index.ts +12 -0
  374. package/dist/contracts/factories/contracts/interfaces/IERC721MetadataUpgradeable__factory.js +137 -0
  375. package/dist/contracts/factories/contracts/interfaces/IERC721MetadataUpgradeable__factory.ts +185 -0
  376. package/dist/contracts/factories/contracts/interfaces/ISBTUpgradeable__factory.js +103 -0
  377. package/dist/contracts/factories/contracts/interfaces/ISBTUpgradeable__factory.ts +136 -0
  378. package/dist/contracts/factories/contracts/interfaces/ITitleEscrowFactory__factory.js +81 -0
  379. package/dist/contracts/factories/contracts/interfaces/ITitleEscrowFactory__factory.ts +111 -0
  380. package/dist/contracts/factories/contracts/interfaces/ITitleEscrowSignable__factory.js +630 -0
  381. package/dist/contracts/factories/contracts/interfaces/ITitleEscrowSignable__factory.ts +803 -0
  382. package/dist/contracts/factories/contracts/interfaces/ITitleEscrow__factory.js +515 -0
  383. package/dist/contracts/factories/contracts/interfaces/ITitleEscrow__factory.ts +652 -0
  384. package/dist/contracts/factories/contracts/interfaces/ITradeTrustSBT__factory.js +179 -0
  385. package/dist/contracts/factories/contracts/interfaces/ITradeTrustSBT__factory.ts +234 -0
  386. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenBurnable__factory.js +33 -0
  387. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenBurnable__factory.ts +48 -0
  388. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenMintable__factory.js +45 -0
  389. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenMintable__factory.ts +64 -0
  390. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenRestorable__factory.js +37 -0
  391. package/dist/contracts/factories/contracts/interfaces/ITradeTrustTokenRestorable__factory.ts +54 -0
  392. package/dist/contracts/factories/contracts/interfaces/ITradeTrustToken__factory.js +237 -0
  393. package/dist/contracts/factories/contracts/interfaces/ITradeTrustToken__factory.ts +310 -0
  394. package/dist/contracts/factories/contracts/interfaces/RegistryAccessErrors__factory.js +23 -0
  395. package/dist/contracts/factories/contracts/interfaces/RegistryAccessErrors__factory.ts +35 -0
  396. package/dist/contracts/factories/contracts/interfaces/SigHelperErrors__factory.js +23 -0
  397. package/dist/contracts/factories/contracts/interfaces/SigHelperErrors__factory.ts +31 -0
  398. package/dist/contracts/factories/contracts/interfaces/TDocDeployerErrors__factory.js +39 -0
  399. package/dist/contracts/factories/contracts/interfaces/TDocDeployerErrors__factory.ts +52 -0
  400. package/dist/contracts/factories/contracts/interfaces/TitleEscrowErrors__factory.js +103 -0
  401. package/dist/contracts/factories/contracts/interfaces/TitleEscrowErrors__factory.ts +134 -0
  402. package/dist/contracts/factories/contracts/interfaces/TitleEscrowFactoryErrors__factory.js +23 -0
  403. package/dist/contracts/factories/contracts/interfaces/TitleEscrowFactoryErrors__factory.ts +35 -0
  404. package/dist/contracts/factories/contracts/interfaces/TitleEscrowSignableErrors__factory.js +63 -0
  405. package/dist/contracts/factories/contracts/interfaces/TitleEscrowSignableErrors__factory.ts +88 -0
  406. package/dist/contracts/factories/contracts/interfaces/TradeTrustTokenErrors__factory.js +39 -0
  407. package/dist/contracts/factories/contracts/interfaces/TradeTrustTokenErrors__factory.ts +55 -0
  408. package/dist/contracts/factories/contracts/interfaces/index.js +124 -0
  409. package/dist/contracts/factories/contracts/interfaces/index.ts +21 -0
  410. package/dist/contracts/factories/contracts/mocks/ERC721ReceiverMock__factory.js +109 -0
  411. package/dist/contracts/factories/contracts/mocks/ERC721ReceiverMock__factory.ts +158 -0
  412. package/dist/contracts/factories/contracts/mocks/SBTUpgradeableMock__factory.js +262 -0
  413. package/dist/contracts/factories/contracts/mocks/SBTUpgradeableMock__factory.ts +367 -0
  414. package/dist/contracts/factories/contracts/mocks/SigHelperMock__factory.js +167 -0
  415. package/dist/contracts/factories/contracts/mocks/SigHelperMock__factory.ts +243 -0
  416. package/dist/contracts/factories/contracts/mocks/SimpleCaller__factory.js +56 -0
  417. package/dist/contracts/factories/contracts/mocks/SimpleCaller__factory.ts +92 -0
  418. package/dist/contracts/factories/contracts/mocks/TitleEscrowFactoryCallerMock__factory.js +52 -0
  419. package/dist/contracts/factories/contracts/mocks/TitleEscrowFactoryCallerMock__factory.ts +92 -0
  420. package/dist/contracts/factories/contracts/mocks/TitleEscrowFactoryGetterMock__factory.js +80 -0
  421. package/dist/contracts/factories/contracts/mocks/TitleEscrowFactoryGetterMock__factory.ts +129 -0
  422. package/dist/contracts/factories/contracts/mocks/TitleEscrowMock__factory.js +714 -0
  423. package/dist/contracts/factories/contracts/mocks/TitleEscrowMock__factory.ts +926 -0
  424. package/dist/contracts/factories/contracts/mocks/TradeTrustTokenMock__factory.js +658 -0
  425. package/dist/contracts/factories/contracts/mocks/TradeTrustTokenMock__factory.ts +901 -0
  426. package/dist/contracts/factories/contracts/mocks/index.js +61 -0
  427. package/dist/contracts/factories/contracts/mocks/index.ts +12 -0
  428. package/dist/contracts/factories/contracts/presets/TitleEscrowSignable__factory.js +915 -0
  429. package/dist/contracts/factories/contracts/presets/TitleEscrowSignable__factory.ts +1195 -0
  430. package/dist/contracts/factories/contracts/presets/TradeTrustTokenStandard__factory.js +628 -0
  431. package/dist/contracts/factories/contracts/presets/TradeTrustTokenStandard__factory.ts +838 -0
  432. package/dist/contracts/factories/contracts/presets/index.js +19 -0
  433. package/dist/contracts/factories/contracts/presets/index.ts +6 -0
  434. package/dist/contracts/factories/contracts/utils/SigHelper__factory.js +61 -0
  435. package/dist/contracts/factories/contracts/utils/SigHelper__factory.ts +79 -0
  436. package/dist/contracts/factories/contracts/utils/TDocDeployer__factory.js +340 -0
  437. package/dist/contracts/factories/contracts/utils/TDocDeployer__factory.ts +459 -0
  438. package/dist/contracts/factories/contracts/utils/index.js +19 -0
  439. package/dist/contracts/factories/contracts/utils/index.ts +6 -0
  440. package/dist/contracts/factories/index.js +12 -0
  441. package/dist/contracts/factories/index.ts +6 -0
  442. package/dist/contracts/hardhat.d.js +5 -0
  443. package/dist/contracts/hardhat.d.ts +1144 -0
  444. package/dist/contracts/index.js +430 -0
  445. package/dist/contracts/index.ts +129 -0
  446. package/dist/index.js +12 -0
  447. package/dist/types/constants/contract-address.d.ts +11 -0
  448. package/dist/types/constants/contract-interface-id.d.ts +10 -0
  449. package/dist/types/constants/contract-interfaces.d.ts +11 -0
  450. package/dist/types/constants/default-address.d.ts +4 -0
  451. package/dist/types/constants/index.d.ts +4 -0
  452. package/dist/types/constants/role-hash.d.ts +9 -0
  453. package/dist/types/hardhat.config.d.ts +8 -0
  454. package/dist/types/index.d.ts +2 -0
  455. package/dist/types/utils/compute-interface-id.d.ts +1 -0
  456. package/dist/types/utils/compute-title-escrow-address.d.ts +10 -0
  457. package/dist/types/utils/encode-init-params.d.ts +6 -0
  458. package/dist/types/utils/get-event-from-receipt.d.ts +29 -0
  459. package/dist/types/utils/index.d.ts +4 -0
  460. package/dist/utils/compute-interface-id.js +28 -0
  461. package/dist/utils/compute-title-escrow-address.js +31 -0
  462. package/dist/utils/encode-init-params.js +24 -0
  463. package/dist/utils/get-event-from-receipt.js +62 -0
  464. package/dist/utils/index.js +49 -0
  465. package/package.json +145 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,446 @@
1
+ License
2
+ This project is based on Token Registry software originally licensed under the Apache License, Version 2.0.
3
+
4
+ Modifications
5
+ This distribution contains modifications made by yl, including but not limited to:
6
+
7
+ All such modifications are Β© [yl-2025].
8
+
9
+ Original License
10
+ The original work is licensed under the Apache License, Version 2.0.
11
+ A copy of the license is included in the LICENSE file.
12
+ <h1 align="center">
13
+
14
+ <p align="center">Token Registry</p>
15
+ <a href="https://tradetrust.io"><img src="docs/images/tt-logo.png" alt="TradeTrust Token Registry" /></a>
16
+ </h1>
17
+
18
+ <p align="center">
19
+ <a href="https://tradetrust.io">TradeTrust</a> Electronic Bill of Lading (eBL)
20
+ </p>
21
+
22
+ <p align="center">
23
+ <a href="https://github.com/tradetrust/token-registry/tree/master" alt="Release"><img src="https://github.com/tradetrust/token-registry/actions/workflows/release.yml/badge.svg?event=push" /></a>
24
+ <a href="https://codecov.io/gh/Open-Attestation/token-registry" alt="Code Coverage"><img src="https://codecov.io/gh/Open-Attestation/token-registry/branch/master/graph/badge.svg?token=Y4R9SWXATG" /></a>
25
+ <a href="https://www.npmjs.com/package/@tradetrust-tt/token-registry" alt="NPM"><img src="https://img.shields.io/npm/dw/@tradetrust-tt/token-registry" /></a>
26
+ <img src="https://img.shields.io/github/license/open-attestation/token-registry" />
27
+ </p>
28
+
29
+ The Electronic Bill of Lading (eBL) is a digital document that can be used to prove the ownership of goods. It is a standardised document that is accepted by all major shipping lines and customs authorities. The [Token Registry](https://github.com/TradeTrust/token-registry) repository contains both the smart contract
30
+ code for token registry (in `/contracts`) as well as the node package for using this library (in `/src`).
31
+
32
+ ## Table of Contents
33
+
34
+ - [Installation](#installation)
35
+ - [Usage](#usage)
36
+ - [TradeTrustToken](#tradetrusttoken)
37
+ - [Connect to existing token registry](#connect-to-existing-token-registry)
38
+ - [Issuing a Document](#issuing-a-document)
39
+ - [Restoring a Document](#restoring-a-document)
40
+ - [Accept/Burn a Document](#acceptburn-a-document)
41
+ - [Title Escrow](#title-escrow)
42
+ - [Connect to Title Escrow](#connect-to-title-escrow)
43
+ - [Transfer of Beneficiary/Holder](#transfer-of-beneficiaryholder)
44
+ - [Reject Transfers of Beneficiary/Holder](#reject-transfers-of-beneficiaryholder)
45
+ - [Return ETR Document to Issuer](#return-etr-document-to-issuer)
46
+ - [Accessing the Current Owners](#accessing-the-current-owners)
47
+ - [Provider \& Signer](#provider--signer)
48
+ - [Roles and Access](#roles-and-access)
49
+ - [Grant a role to a user](#grant-a-role-to-a-user)
50
+ - [Revoke a role from a user](#revoke-a-role-from-a-user)
51
+ - [Setting a role admin (Advanced Usage)](#setting-a-role-admin-advanced-usage)
52
+ - [Deployment](#deployment)
53
+ - [Quick Start](#quick-start)
54
+ - [Advanced Usage](#advanced-usage)
55
+ - [Token Contract](#token-contract)
56
+ - [Using an existing Title Escrow Factory](#using-an-existing-title-escrow-factory)
57
+ - [Title Escrow Factory](#title-escrow-factory)
58
+ - [Deploy a new Title Escrow Factory](#deploy-a-new-title-escrow-factory)
59
+ - [Verification](#verification)
60
+ - [Network Configuration](#network-configuration)
61
+ - [Configuration](#configuration)
62
+ - [Development](#development)
63
+ - [Scripts](#scripts)
64
+ - [Subgraph](#subgraph)
65
+ - [Notes](#notes)
66
+
67
+ # Installation
68
+
69
+ ```sh
70
+ npm install --save @tradetrust-tt/token-registry
71
+ ```
72
+
73
+ ---
74
+
75
+ # Usage
76
+
77
+ To use the package, you will need to provide your own
78
+ Web3 [provider](https://docs.ethers.io/v5/api/providers/api-providers/)
79
+ or [signer](https://docs.ethers.io/v5/api/signer/#Wallet) (if you are writing to the blockchain).
80
+ This package exposes the [Typechain (Ethers)](https://github.com/dethcrypto/TypeChain/tree/master/packages/target-ethers-v6) bindings for the contracts.
81
+
82
+ ## TradeTrustToken
83
+
84
+ The `TradeTrustToken` is a Soulbound Token (SBT) tied to the Title Escrow. The SBT implementation is loosely based on OpenZeppelin's implementation of the [ERC721](http://erc721.org/) standard.
85
+ An SBT is used in this case because the token, while can be transferred to the registry, is largely restricted to its designated Title Escrow contracts.
86
+ See issue [#108](https://github.com/Open-Attestation/token-registry/issues/108) for more details.
87
+
88
+ ### Connect to existing token registry
89
+
90
+ ```ts
91
+ import { TradeTrustToken__factory } from "@tradetrust-tt/token-registry/contracts";
92
+
93
+ const connectedRegistry = TradeTrustToken__factory.connect(tokenRegistryAddress, signer);
94
+ ```
95
+
96
+ ### Issuing a Document
97
+
98
+ ```ts
99
+ await connectedRegistry.mint(beneficiaryAddress, holderAddress, tokenId, remarks);
100
+ ```
101
+
102
+ ### Restoring a Document
103
+
104
+ ```ts
105
+ await connectedRegistry.restore(tokenId, remarks);
106
+ ```
107
+
108
+ ### Accept/Burn a Document
109
+
110
+ ```ts
111
+ await connectedRegistry.burn(tokenId, remarks);
112
+ ```
113
+
114
+ ## Title Escrow
115
+
116
+ The Title Escrow contract is used to manage and represent the ownership of a token between a **`beneficiary`** and **`holder`**.
117
+ During minting, the Token Registry will create and assign a Title Escrow as the owner of that token.
118
+ The actual owners will use the Title Escrow contract to perform their ownership operations.
119
+
120
+ > [!IMPORTANT]
121
+ > A new `remark` field has been **introduced** for all contract operations.
122
+ >
123
+ > The `remark` field is optional and can be left empty by providing an empty string `"0x"`.
124
+ > Please note that any value in the `remark` field is limited to **120** characters, and encryption is **recommended**.
125
+ >
126
+ > Please refer to the sample encryption implementation [here]().
127
+
128
+ ### Connect to Title Escrow
129
+
130
+ ```ts
131
+ import { TitleEscrow__factory } from "@tradetrust-tt/token-registry/contracts";
132
+
133
+ const connectedEscrow = TitleEscrow__factory.connect(existingTitleEscrowAddress, signer);
134
+ ```
135
+
136
+ ### Transfer of Beneficiary/Holder
137
+
138
+ Transferring of **`beneficiary`** and **`holder`** within the Title Escrow relies on the following methods:
139
+
140
+ ```solidity
141
+ function transferBeneficiary(address nominee, bytes calldata remark) external;
142
+
143
+ function transferHolder(address newHolder, bytes calldata remark) external;
144
+
145
+ function transferOwners(address nominee, address newHolder, bytes calldata remark) external;
146
+
147
+ function nominate(address nominee, bytes calldata remark) external;
148
+ ```
149
+
150
+ > [!NOTE]
151
+ > The `transferBeneficiary` transfers only the beneficiary and `transferHolder` transfers only the holder.
152
+ > To transfer both beneficiary and holder in a single transaction, use `transferOwners`.
153
+ >
154
+ > In the event where the **`holder`** is different from the **`beneficiary`**, the transfer of beneficiary will require a nomination done through the `nominate` method.
155
+
156
+ ### Reject Transfers of Beneficiary/Holder
157
+
158
+ Rejection of transfers for any wrongful transactions.
159
+
160
+ ```solidity
161
+ function rejectTransferBeneficiary(bytes calldata _remark) external;
162
+
163
+ function rejectTransferHolder(bytes calldata _remark) external;
164
+
165
+ function rejectTransferOwners(bytes calldata _remark) external;
166
+ ```
167
+
168
+ > [!IMPORTANT]
169
+ > Rejection must occur as the very next action after being appointed as **`beneficiary`** and/or **`holder`**. If any transactions occur by the new appointee, it will be considered as an implicit acceptance of appointment.
170
+ >
171
+ > There are separate methods to reject a **`beneficiary`** (`rejectTransferBeneficiary`) and a **`holder`** (`rejectTransferHolder`). However, if you are both, you must use `rejectTransferOwners`, as the other two methods will not work in this case.
172
+
173
+ ### Return ETR Document to Issuer
174
+
175
+ Use the `returnToIssuer` method in the Title Escrow.
176
+
177
+ ```solidity
178
+ function returnToIssuer(bytes calldata remark) external;
179
+ ```
180
+
181
+ ### Accessing the Current Owners
182
+
183
+ The addresses of the current owners can be retrieved from the `beneficiary`, `holder` and `nominee` methods.
184
+
185
+ Example:
186
+
187
+ ```ts
188
+ const currentBeneficiary = await connectedEscrow.beneficiary();
189
+
190
+ const currentHolder = await connectedEscrow.holder();
191
+
192
+ const nominatedBeneficiary = await connectedEscrow.nominee();
193
+ ```
194
+
195
+ ## Provider & Signer
196
+
197
+ Different ways to get provider or signer:
198
+
199
+ ```ts
200
+ import { Wallet, providers, getDefaultProvider } from "ethers";
201
+
202
+ // Providers
203
+ const mainnetProvider = getDefaultProvider();
204
+ const metamaskProvider = new providers.Web3Provider(web3.currentProvider); // Will change network automatically
205
+
206
+ // Signer
207
+ const signerFromPrivateKey = new Wallet("YOUR-PRIVATE-KEY-HERE", provider);
208
+ const signerFromEncryptedJson = Wallet.fromEncryptedJson(json, password);
209
+ signerFromEncryptedJson.connect(provider);
210
+
211
+ const signerFromMnemonic = Wallet.fromMnemonic("MNEMONIC-HERE");
212
+ signerFromMnemonic.connect(provider);
213
+ ```
214
+
215
+ ## Roles and Access
216
+
217
+ Roles are useful for granting users to access certain functions only. Currently, here are the designated roles meant for the different key operations.
218
+
219
+ | Role | Access |
220
+ | -------------- | ------------------------------------------ |
221
+ | `DefaultAdmin` | Able to perform all operations |
222
+ | `MinterRole` | Able to mint new tokens |
223
+ | `AccepterRole` | Able to accept a token returned to issuer |
224
+ | `RestorerRole` | Able to restore a token returned to issuer |
225
+
226
+ A trusted user can be granted multiple roles by the admin user to perform different operations.
227
+ The following functions can be called on the token contract by the admin user to grant and revoke roles to and from users.
228
+
229
+ ### Grant a role to a user
230
+
231
+ ```ts
232
+ import { constants } from "@tradetrust-tt/token-registry";
233
+
234
+ await connectedRegistry.grantRole(constants.roleHash.MinterRole, accountAddress);
235
+ ```
236
+
237
+ > [!IMPORTANT]
238
+ > Can only be called by **default admin** or **role admin**.
239
+
240
+ ### Revoke a role from a user
241
+
242
+ ```ts
243
+ import { constants } from "@tradetrust-tt/token-registry";
244
+
245
+ await connectedRegistry.revokeRole(constants.roleHash.AccepterRole, accountAddress);
246
+ ```
247
+
248
+ > [!IMPORTANT]
249
+ > Can only be called by **default admin** or **role admin**.
250
+
251
+ ### Setting a role admin (Advanced Usage)
252
+
253
+ The standard setup does not add the role-admin roles so that users don't deploy (and, hence, pay the gas for) more than what they need.
254
+ If you need a more complex setup, you can add the admin roles to the designated roles.
255
+
256
+ ```ts
257
+ import { constants } from "@tradetrust-tt/token-registry";
258
+ const { roleHash } = constants;
259
+
260
+ await connectedRegistry.setRoleAdmin(roleHash.MinterRole, roleHash.MinterAdminRole);
261
+ await connectedRegistry.setRoleAdmin(roleHash.RestorerRole, roleHash.RestorerAdminRole);
262
+ await connectedRegistry.setRoleAdmin(roleHash.AccepterRole, roleHash.AccepterAdminRole);
263
+ ```
264
+
265
+ > [!IMPORTANT]
266
+ > Can only be called by **default admin**.
267
+
268
+ # Deployment
269
+
270
+ Hardhat is used to manage the contract development environment and deployment. This repository provides a couple of
271
+ Hardhat tasks to simplify the deployment process.
272
+
273
+ Starting from v4, we have included an easy and cost-effective way to deploy the contracts while also keeping options available for advanced users to setup the contracts their preferred way.
274
+
275
+ > [!TIP]
276
+ > πŸ’‘ Please ensure that you have setup your configuration file before deployment.
277
+ >
278
+ > See [Configuration](#configuration) section for more details. The deployer (configured in your `.env` file) will be made the default admin.
279
+
280
+ ## Quick Start
281
+
282
+ For users who want to quickly deploy their contracts without too much hassle, you’ll only have to supply the name and symbol of your token to the command, and you’re ready to roll!
283
+
284
+ ```
285
+ npx hardhat deploy:token --network stability --name "The Great Shipping Co." --symbol GSC
286
+ ```
287
+
288
+ πŸ‘† This is the easiest and most cost-effective method to deploy. The deployed contract will inherit all the standard functionality from our on-chain contracts. This helps to save deployment costs and make the process more convenient for users and integrators.
289
+
290
+ > [!TIP]
291
+ > πŸ’‘ Remember to supply the `--network` argument with the name of the network you wish to deploy on.
292
+ >
293
+ > See [Network Configuration](#network-configuration) section for more info on the list of network names.
294
+
295
+ ## Advanced Usage
296
+
297
+ For experienced users who would like to have more control over their setup (or have extra πŸ’° to spend πŸ’Έ), we have provided a few other options and commands.
298
+ However, you should be aware that, depending on what you’re doing, the gas costs could be higher than the method described in [Quick Start](#quick-start).
299
+ You should already know what you are doing when using any of these options.
300
+
301
+ ### Token Contract
302
+
303
+ Deploys the token contract.
304
+
305
+ ```
306
+ user@NMacBook-Pro token-registry % npx hardhat deploy:token --help
307
+
308
+ Usage: hardhat [GLOBAL OPTIONS] deploy:token --factory <STRING> --name <STRING> [--standalone] --symbol <STRING> [--verify]
309
+
310
+ OPTIONS:
311
+
312
+ --factory Address of Title Escrow factory (Optional)
313
+ --name Name of the token
314
+ --standalone Deploy as standalone token contract
315
+ --symbol Symbol of token
316
+ --verify Verify on Etherscan
317
+
318
+ deploy:token: Deploys the TradeTrust token
319
+ ```
320
+
321
+ > [!TIP]
322
+ > πŸ’‘ Note that the `--factory` argument is optional. When not provided, the task will use the default Title Escrow Factory.
323
+ > You can also reuse a Title Escrow factory that you have previously deployed by passing its address to the `--factory` argument.
324
+
325
+ #### Using an existing Title Escrow Factory
326
+
327
+ - To use an existing version of Title Escrow factory, you can supply its address to the `β€”-factory` argument.
328
+
329
+ - To use your own version of Title Escrow factory, you need to supply its address to the `--factory` with the `--standalone` flag.
330
+
331
+ ```
332
+ npx hardhat deploy:token --network polygon --name "The Great Shipping Co." --symbol GSC --factory 0xfac70
333
+ ```
334
+
335
+ πŸ‘† This will deploy a "cheap" token contract with the name _The Great Shipping Co._ under the symbol _GSC_ on the _Polygon Mainnet_
336
+ network using an existing Title Escrow factory at `0xfac70`.
337
+
338
+ ### Title Escrow Factory
339
+
340
+ Deploys the Title Escrow factory.
341
+
342
+ ```
343
+ user@NMacBook-Pro token-registry % npx hardhat deploy:token --help
344
+
345
+ Usage: hardhat [GLOBAL OPTIONS] deploy:factory [--verify]
346
+
347
+ OPTIONS:
348
+
349
+ --verify Verify on Etherscan
350
+
351
+ deploy:factory: Deploys a new Title Escrow factory
352
+ ```
353
+
354
+ #### Deploy a new Title Escrow Factory
355
+
356
+ If you want to deploy your own modified version or simply want to have your own copy of the Title Escrow factory, you can use this command:
357
+
358
+ ```
359
+ npx hardhat deploy:factory --network amoy
360
+ ```
361
+
362
+ πŸ‘† This will deploy a new Title Escrow factory on the _Amoyy_ network without verifying the contract.
363
+ To verify the contract, pass in the `--verify` flag.
364
+
365
+ ## Verification
366
+
367
+ When verifying the contracts through either the Hardhat's verify plugin or passing the `--verify` flag to the deployment
368
+ tasks (which internally uses the same plugin), you will need to include your correct API key, depending on the network, in your `.env` configuration. See [Configuration](#configuration) section for more info.
369
+
370
+ - For Ethereum, set `ETHERSCAN_API_KEY`.
371
+ - For Polygon, set `POLYGONSCAN_API_KEY`.
372
+ - For Astron, set `ASTRON_API_KEY`.
373
+ - For Astrontestnet, set `ASTRON_TESTNET_API_KEY`.
374
+
375
+ ## Network Configuration
376
+
377
+ Here's a list of network names currently pre-configured:
378
+
379
+ - `mainnet` (Ethereum)
380
+ - `sepolia`
381
+ - `polygon` (Polygon Mainnet)
382
+ - `amoy` (Polygon Amoy)
383
+ - `xdc` (XDC Network Mainnet)
384
+ - `xdcapothem` (XDC Apothem TestNet)
385
+ - `stabilitytestnet` (Stability TestNet)
386
+ - `stability` (Stability Global Trust Network)
387
+ - `astron` (astron Network MainNet)
388
+ - `astrontestnet` (astron Network TestNet)
389
+
390
+ > [!TIP]
391
+ > πŸ’‘ You can configure existing and add other networks you wish to deploy to in the `hardhat.config.ts` file.
392
+
393
+ # Configuration
394
+
395
+ Create a `.env` file and add your own keys into it. You can rename from the sample file `.env.sample` or copy the
396
+ following into a new file:
397
+
398
+ ```
399
+ # Infura
400
+ INFURA_APP_ID=
401
+
402
+ # API Keys
403
+ ETHERSCAN_API_KEY=
404
+ POLYGONSCAN_API_KEY=
405
+ COINMARKETCAP_API_KEY=
406
+ STABILITY_API_KEY=
407
+ ASTRONSCAN_API_KEY=
408
+ ASTRON_TESTNET_API_KEY=
409
+
410
+ # Deployer Private Key
411
+ DEPLOYER_PK=
412
+
413
+ # Mnemonic words
414
+ MNEMONIC=
415
+ ```
416
+
417
+ Only either the `DEPLOYER_PK` or `MNEMONIC` is needed.
418
+
419
+ # Development
420
+
421
+ This repository's development framework uses [HardHat](https://hardhat.org/getting-started/).
422
+
423
+ Tests are run using `npm run test`, more development tasks can be found in the package.json scripts.
424
+
425
+ ## Scripts
426
+
427
+ ```sh
428
+ npm install
429
+ npm test
430
+ npm run lint
431
+ npm run build
432
+
433
+ # See Deployment section for more info
434
+ npx hardhat deploy:token
435
+ npx hardhat deploy:factory
436
+ npx hardhat deploy:token:impl
437
+ ```
438
+
439
+ # Subgraph
440
+
441
+ Check out our [Token Registry Subgraph](https://github.com/tradetrust/token-registry-subgraph) Github repository
442
+ for more information on using and deploying your own subgraphs for the Token Registry contracts.
443
+
444
+ # Notes
445
+
446
+ - The contracts have not gone through formal audits yet. Please use them at your own discretion.