Skip to content

Commit

Permalink
fix: tt 372 deploy v5 contracts (#33)
Browse files Browse the repository at this point in the history
* refactor: update method and event name

* fix: deleted tt-base file

* fix: removed amoy url

* chore: upgrade to EtersV6

* chore: upgrade oppenzeppelin contracts

* chore: upgrad contracts upgradable

* fix: lintng fixes

* fix: lintig errors

* fix: lint

* chore:deploy latest version contracts

* chore: upgraded addresses

* chore: upgrade smart contracts from v8.0 to v8.20 and update addresses

* chore: Update tasks/deploy-token.ts

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: deploy latest version contracts

* chore: upgraded addresses

* chore: upgrade smart contracts from v8.0 to v8.20 and update addresses

* chore: bump

* chore: bump

* chore: bump

* chore: bump

* chore: bump

* fix: update code support (#28)

* fix: make sure code supports ethers v5

* fix: v5 errors

* fix: resolve v5 import

* chore: fix linting

---------

Co-authored-by: Rishabh Singh <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ng Han Inn <[email protected]>
  • Loading branch information
4 people authored Nov 26, 2024
1 parent 9b4f1a1 commit 1ce973b
Show file tree
Hide file tree
Showing 51 changed files with 456 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ yarn-error.log
/contracts/.deps
/coverage
coverage.json
.openzeppelin/
2 changes: 1 addition & 1 deletion contracts/TitleEscrow.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import { Pausable } from "@openzeppelin/contracts/utils/Pausable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/TitleEscrowFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol";
import { TitleEscrow } from "./TitleEscrow.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/TradeTrustToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustTokenBase, ITitleEscrowFactory } from "./base/TradeTrustTokenBase.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/base/RegistryAccess.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { RegistryAccessErrors } from "../interfaces/RegistryAccessErrors.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/SBTUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { ContextUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustSBT.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import { SBTUpgradeable } from "./SBTUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustTokenBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { RegistryAccess } from "./RegistryAccess.sol";
import { TradeTrustTokenBurnable, TradeTrustSBT, SBTUpgradeable } from "./TradeTrustTokenBurnable.sol"; //check-circular-imports
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustTokenBaseURI.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustSBT } from "./TradeTrustSBT.sol";
import { RegistryAccess } from "./RegistryAccess.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustTokenBurnable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustSBT, ITitleEscrow, SBTUpgradeable } from "./TradeTrustSBT.sol";
import { RegistryAccess } from "./RegistryAccess.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustTokenMintable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustSBT, ITitleEscrow, SBTUpgradeable } from "./TradeTrustSBT.sol";
import { RegistryAccess } from "./RegistryAccess.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/TradeTrustTokenRestorable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustSBT, ITitleEscrow, SBTUpgradeable } from "./TradeTrustSBT.sol";
import { RegistryAccess } from "./RegistryAccess.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC721MetadataUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { ISBTUpgradeable } from "./ISBTUpgradeable.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISBTUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITitleEscrow.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITitleEscrowFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface ITitleEscrowFactory {
event TitleEscrowCreated(address indexed titleEscrow, address indexed tokenRegistry, uint256 indexed tokenId);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITitleEscrowSignable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { SigHelper } from "../utils/SigHelper.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITradeTrustSBT.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { ISBTUpgradeable, IERC165 } from "./ISBTUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITradeTrustToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { ITradeTrustSBT, ITitleEscrowFactory } from "./ITradeTrustSBT.sol";
import { ITradeTrustTokenRestorable } from "./ITradeTrustTokenRestorable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITradeTrustTokenBurnable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface ITradeTrustTokenBurnable {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITradeTrustTokenMintable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface ITradeTrustTokenMintable {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ITradeTrustTokenRestorable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface ITradeTrustTokenRestorable {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/RegistryAccessErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface RegistryAccessErrors {
error InvalidAdminAddress();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/SigHelperErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface SigHelperErrors {
error SignatureAlreadyCancelled();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/TDocDeployerErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface TDocDeployerErrors {
error UnsupportedImplementationContractAddress();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/TitleEscrowErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface TitleEscrowErrors {
error CallerNotBeneficiary();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/TitleEscrowFactoryErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface TitleEscrowFactoryErrors {
error CreateCallerNotContract();
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/TitleEscrowSignableErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface TitleEscrowSignableErrors {
error SignatureExpired(uint256 currentTimestamp);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/TradeTrustTokenErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

interface TradeTrustTokenErrors {
error TokenNotReturnedToIssuer();
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/TitleEscrowStructs.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

/**
@dev BeneficiaryTransferEndorsement represents the endorsement details.
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC721ReceiverMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/SBTUpgradeableMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { SBTUpgradeable } from "../base/SBTUpgradeable.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/SigHelperMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { SigHelper } from "../utils/SigHelper.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/SimpleCaller.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

contract SimpleCaller {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TitleEscrowFactoryCallerMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { ITitleEscrowFactory } from "../interfaces/ITitleEscrowFactory.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TitleEscrowFactoryGetterMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { ITitleEscrowFactory } from "../interfaces/ITitleEscrowFactory.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TitleEscrowMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TitleEscrow } from "../TitleEscrow.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TradeTrustTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustToken } from "../TradeTrustToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/presets/TitleEscrowSignable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TitleEscrow } from "../TitleEscrow.sol";
import { SigHelper } from "../utils/SigHelper.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/presets/TradeTrustTokenStandard.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { TradeTrustTokenBase, ITitleEscrowFactory } from "../base/TradeTrustTokenBase.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/SigHelper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import { SigHelperErrors } from "../interfaces/SigHelperErrors.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/TDocDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
pragma solidity ^0.8.20;

import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol";
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
Expand Down
15 changes: 13 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "@nomicfoundation/hardhat-toolbox";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import { randomBytes } from "crypto";
import dotenv from "dotenv";
import "hardhat-watcher";
Expand Down Expand Up @@ -40,7 +41,7 @@ if (IS_CI_ENV) {

const config: HardhatUserConfig = {
solidity: {
compilers: [{ version: "0.8.27" }],
compilers: [{ version: "0.8.22" }],

settings: {
optimizer: {
Expand All @@ -67,6 +68,7 @@ const config: HardhatUserConfig = {
gasReporter: {
coinmarketcap: COINMARKETCAP_API_KEY,
currency: "USD",
enabled: true,
},
etherscan: {
apiKey: {
Expand All @@ -78,6 +80,14 @@ const config: HardhatUserConfig = {
* Polygon
*/
polygon: POLYGONSCAN_API_KEY!,
/**
* polygon amoy
*/
polygonAmoy: POLYGONSCAN_API_KEY!,
/**
* stability testnet
*/
stabilitytestnet: STABILITY_API_KEY!,
},
},
networks: {
Expand Down Expand Up @@ -128,7 +138,8 @@ const config: HardhatUserConfig = {
},
amoy: {
...networkConfig,
url: `https://polygon-amoy.infura.io/v3/${INFURA_APP_ID}`,
url: "https://rpc-amoy.polygon.technology",
// url: `https://polygon-amoy.infura.io/v3/${INFURA_APP_ID}`,
},
/**
* Development
Expand Down
Loading

0 comments on commit 1ce973b

Please sign in to comment.