Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # todo: only fetch for the HEAD branch
- uses: actions/setup-go@v3
with:
go-version: "1.19"
Expand Down
32 changes: 32 additions & 0 deletions abi/HDT.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "oldToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newToken",
"type": "address"
}
],
"name": "AssetTokenChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -372,6 +391,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newTokenAddress",
"type": "address"
}
],
"name": "setAssetToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
7 changes: 7 additions & 0 deletions contracts/HDT/HDT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import "../Errors.sol";
*/
contract HDT is ERC20Upgradeable, OwnableUpgradeable, HDTStorage, IHDT {
event PoolChanged(address pool);
event AssetTokenChanged(address oldToken, address newToken);

constructor() {
_disableInitializers();
Expand Down Expand Up @@ -48,6 +49,12 @@ contract HDT is ERC20Upgradeable, OwnableUpgradeable, HDTStorage, IHDT {
emit PoolChanged(poolAddress);
}

function setAssetToken(address newTokenAddress) external onlyOwner {
address oldTokenAddress = _assetToken;
_assetToken = newTokenAddress;
emit AssetTokenChanged(oldTokenAddress, newTokenAddress);
}

function decimals() public view override returns (uint8) {
return _decimals;
}
Expand Down
20 changes: 19 additions & 1 deletion deployment/goerli-deployed-contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,22 @@
"HDT":"0x27Fa332a5cA06492C2007FF4b143C921Cf779C3b",
"ReceivableFactoringPoolConfig":"0xBa779F41ae414dEc63265D79a02DED47fbe007a5",
"ReceivableFactoringPoolImpl":"0x470f71B48B42BE5B4B47D9f9A407bDA98DbDEb8D",
"ReceivableFactoringPool":"0x11672c0bBFF498c72BC2200f42461c0414855042"}
"ReceivableFactoringPool":"0x11672c0bBFF498c72BC2200f42461c0414855042",
"JiaPoolTimelock":"0x8DF7BBae57F1215eE8294D084E08B6a02076eAA5",
"JiaPoolProxyAdminTimelock":"0x87Da18395dc7CE21e0E72e1B01dca0826635FCf0",
"JiaPoolFeeManager":"0x4630ceAedb030b6ad1DCa0E58c3576aa33042b4C",
"JiaHDTImpl":"0x3f95c365aa092E3dF020Bf7E6582E371998Ada4A",
"JiaHDT":"0xAD5e1F01618A2A158097C21866B4e8DCEEA2aC25",
"JiaPoolConfig":"0x9b8513bF9A56E609e66F360B550b7c8724129a05",
"JiaPoolImpl":"0xEb204D979c7aBcA473a0BC780dDf6Ca45E84422f",
"JiaPool":"0x07fd5720FE4d7993550d147c8753A9e60b45940D",
"RWReceivableImpl":"0xf48170cc418c432874d32B03EAc3AC820deEF05E",
"RWReceivable":"0xA1EB18643dd6b75e97D55583BFFfF2311124076f",
"ArfPoolTimelock":"",
"ArfPoolProxyAdminTimelock":"0x74F1bcfb40A1d7A5A986712382ee2e03b1d472Fb",
"ArfPoolFeeManager":"0x35EC0c62F2185492284ecD1b6ed5aDc5b778B592",
"ArfHDTImpl":"0x67663D157Ea0Cd7075cC149EF64fd5701243Aa2b",
"ArfHDT":"0x8947482a523157A82563720e770E0BE8dfD67Cd7",
"ArfPoolConfig":"0xDE5b0A97017B28A4a55F46B27Ae9B3e89B699672",
"ArfPoolImpl":"0x8a6eb5c93b6ec5Bb213CD9E4a894CE8e08ebFFBf",
"ArfPool":"0x7A0F30f9449aC40eADed6994F1579Fd977506d8a"}
31 changes: 19 additions & 12 deletions deployment/goerli-initialized-contracts.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"EANFT": "Done",
"HumaConfig": "Done",
"BaseCreditPoolFeeManager": "Done",
"BaseCreditHDT": "Done",
"BaseCreditPoolConfig": "Done",
"BaseCreditPool": "Done",
"ReceivableFactoringPoolFeeManager": "Done",
"HDT": "Done",
"ReceivableFactoringPoolConfig": "Done",
"ReceivableFactoringPool": "Done"
}
{"EANFT":"Done",
"HumaConfig":"Done",
"BaseCreditPoolFeeManager":"Done",
"BaseCreditHDT":"Done",
"BaseCreditPoolConfig":"Done",
"BaseCreditPool":"Done",
"ReceivableFactoringPoolFeeManager":"Done",
"HDT":"Done",
"ReceivableFactoringPoolConfig":"Done",
"ReceivableFactoringPool":"Done",
"JiaPoolFeeManager":"Done",
"JiaHDT":"Done",
"JiaPoolConfig":"Done",
"JiaPool":"Done",
"ArfPoolFeeManager":"Done",
"ArfHDT":"Done",
"RWReceivable":"Done",
"ArfPoolConfig":"Done",
"ArfPool":"Done"}
20 changes: 19 additions & 1 deletion deployment/goerli-verified-contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,22 @@
"HDT":"Done",
"ReceivableFactoringPoolConfig":"Done",
"ReceivableFactoringPoolImpl":"Done",
"ReceivableFactoringPool":"Done"}
"ReceivableFactoringPool":"Done",
"JiaPoolTimelock":"Done",
"JiaPoolProxyAdminTimelock":"Done",
"JiaPoolFeeManager":"Done",
"JiaHDTImpl":"Done",
"JiaHDT":"Done",
"JiaPoolConfig":"Done",
"JiaPoolImpl":"Done",
"JiaPool":"Done",
"RWReceivableImpl":"Done",
"RWReceivable":"Done",
"ArfPoolTimelock":"",
"ArfPoolProxyAdminTimelock":"Done",
"ArfPoolFeeManager":"Done",
"ArfHDTImpl":"Done",
"ArfHDT":"Done",
"ArfPoolConfig":"Done",
"ArfPoolImpl":"Done",
"ArfPool":"Done"}
66 changes: 66 additions & 0 deletions deployment/goerli/deploy-goerli-jia-pool.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const {deploy} = require("../utils.js");

const HUMA_OWNER_MULTI_SIG='0x1931bD73055335Ba06efB22DB96169dbD4C5B4DB';
const POOL_OWNER_MULTI_SIG='0x7dC4018464e724fB2B04d9aC0df6D40B34786318';

async function deployContracts() {
const network = (await hre.ethers.provider.getNetwork()).name;
console.log("network : ", network);
const accounts = await hre.ethers.getSigners();
if (accounts.length == 0) {
throw new Error("Accounts not set!");
}
const deployer = await accounts[0];
console.log("deployer address: " + deployer.address);

const eaService = await accounts[4];
console.log("ea service address: " + eaService.address);

const usdc = await deploy("TestToken", "USDC");
const evaluationAgentNFT = await deploy("EvaluationAgentNFT", "EANFT", [], eaService);
const invoiceNFT = await deploy("InvoiceNFT", "RNNFT", [usdc.address]);

const humaConfig = await deploy("HumaConfig", "HumaConfig");
const humaConfigTL = await deploy("TimelockController", "HumaConfigTimelock", [
0,
[HUMA_OWNER_MULTI_SIG],
[deployer.address],
]);

const baseCreditPoolTL = await deploy("TimelockController", "JiaPoolTimelock", [
0,
[POOL_OWNER_MULTI_SIG],
[deployer.address],
]);

const baseCreditPoolProxyAdminTL = await deploy("TimelockController", "JiaPoolProxyAdminTimelock", [
0,
[POOL_OWNER_MULTI_SIG],
[deployer.address],
]);

const bc_feeManager = await deploy("BaseFeeManager", "JiaPoolFeeManager");
const bc_hdtImpl = await deploy("HDT", "JiaHDTImpl");
const bc_hdt = await deploy("TransparentUpgradeableProxy", "JiaHDT", [
bc_hdtImpl.address,
baseCreditPoolProxyAdminTL.address,
[],
]);
const bc_poolConfig = await deploy("BasePoolConfig", "JiaPoolConfig");

const bc_poolImpl = await deploy("BaseCreditPool", "JiaPoolImpl");
const bc_pool = await deploy("TransparentUpgradeableProxy", "JiaPool", [
bc_poolImpl.address,
baseCreditPoolProxyAdminTL.address,
[],
]);
// End of deploying base credit pool

}

deployContracts()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
Loading