Skip to content

Commit

Permalink
Merge pull request #562 from hats-finance/update-executor-address
Browse files Browse the repository at this point in the history
Deploy V3
  • Loading branch information
jellegerbrandy authored May 20, 2024
2 parents f1aa3e1 + 5a841e7 commit 0895fe6
Show file tree
Hide file tree
Showing 66 changed files with 23,125 additions and 11,574 deletions.
62 changes: 36 additions & 26 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x07865c6E87B9F70255377e024ace6630C1Eaa37F", // USDC
Expand All @@ -31,10 +31,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x07865c6E87B9F70255377e024ace6630C1Eaa37F", // USDC
Expand Down Expand Up @@ -212,10 +212,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", // USDC
Expand All @@ -229,7 +229,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"mainnet": {
"governance": "0xBA5Ddb6Af728F01E91D77D12073548D823f6D1ef",
Expand All @@ -238,10 +240,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
Expand All @@ -254,7 +256,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"optimism": {
"governance": "0x5A6910528b047d3371970dF764ba4046b7DfAd6a",
Expand All @@ -263,10 +267,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", // USDC
Expand All @@ -279,7 +283,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"arbitrum": {
"governance": "0x022B95b4c02bbA85604506E6114485615b0aD09A",
Expand All @@ -288,10 +294,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", // USDC
Expand All @@ -304,7 +310,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"bnb": {
"governance": "0xbFBC2Ab80bD0A12258db952739238e403Be01ece",
Expand All @@ -313,10 +321,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", // USDC
Expand All @@ -329,7 +337,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"base": {
"governance": "0x5c9d8Fd82a5F0E73384cdfe338ba25F346EEA391",
Expand All @@ -338,10 +348,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x4200000000000000000000000000000000000006", // WETH
Expand All @@ -363,10 +373,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "NEED ADDRESS", // USDC
Expand All @@ -388,10 +398,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xd86e243fc0007e6226b07c9a50c9d70d78299eb5", // USDC
Expand All @@ -413,7 +423,7 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
Expand Down
26 changes: 14 additions & 12 deletions deploy/010_deploy_hathackersnft.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@ const CONFIG = require("../config.js");

const func = async function (hre) {
const config = CONFIG[network.name];
const { deployments, getNamedAccounts } = hre;
const { deploy } = deployments;
if (config["deployHackersNFT"]) {
const { deployments, getNamedAccounts } = hre;
const { deploy } = deployments;

const { deployer } = await getNamedAccounts();
const { deployer } = await getNamedAccounts();

let governance = config["governance"];
if (!governance) {
governance = deployer;
}
let governance = config["governance"];
if (!governance) {
governance = deployer;
}

await deploy('HATHackersNFT', {
from: deployer,
args: [governance],
log: true,
});
await deploy('HATHackersNFT', {
from: deployer,
args: [governance],
log: true,
});
}
};

module.exports = func;
Expand Down
96 changes: 49 additions & 47 deletions deploy/011_deploy_hatvaultsnft.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,55 @@ const { network } = require("hardhat");

const func = async function (hre) {
const config = CONFIG[network.name];
const { deployments, getNamedAccounts } = hre;
const { deploy, execute, read } = deployments;

const { deployer } = await getNamedAccounts();

await deploy('HATVaultsV2Data', {
from: deployer,
args: [
(await deployments.get('HATVaultsRegistry')).address
],
log: true,
});

const nftConfig = config.hatVaultsNFTConf || {};
let merkleTreeIPFSRef = nftConfig.merkleTreeIPFSRef;
if (!merkleTreeIPFSRef) {
merkleTreeIPFSRef = "";
}

let root = nftConfig.root;
if (!root) {
root = ethers.constants.HashZero;
}

let deadline = nftConfig.deadline;
if (!deadline) {
const now = (await ethers.provider.getBlock(await ethers.provider.getBlockNumber())).timestamp;
deadline = now + (5 * 60);
}

await deploy('HATVaultsNFT', {
from: deployer,
args: [
merkleTreeIPFSRef,
root,
deadline
],
log: true,
});

let governance = config["governance"];
if (!governance && network.name === "hardhat") {
governance = deployer;
}

if ((await read('HATVaultsNFT', {}, 'owner')) !== governance) {
await execute('HATVaultsNFT', { from: deployer, log: true }, 'transferOwnership', governance);
if (config["deployVaultsNFT"]) {
const { deployments, getNamedAccounts } = hre;
const { deploy, execute, read } = deployments;

const { deployer } = await getNamedAccounts();

await deploy('HATVaultsV2Data', {
from: deployer,
args: [
(await deployments.get('HATVaultsRegistry')).address
],
log: true,
});

const nftConfig = config.hatVaultsNFTConf || {};
let merkleTreeIPFSRef = nftConfig.merkleTreeIPFSRef;
if (!merkleTreeIPFSRef) {
merkleTreeIPFSRef = "";
}

let root = nftConfig.root;
if (!root) {
root = ethers.constants.HashZero;
}

let deadline = nftConfig.deadline;
if (!deadline) {
const now = (await ethers.provider.getBlock(await ethers.provider.getBlockNumber())).timestamp;
deadline = now + (5 * 60);
}

await deploy('HATVaultsNFT', {
from: deployer,
args: [
merkleTreeIPFSRef,
root,
deadline
],
log: true,
});

let governance = config["governance"];
if (!governance && network.name === "hardhat") {
governance = deployer;
}

if ((await read('HATVaultsNFT', {}, 'owner')) !== governance) {
await execute('HATVaultsNFT', { from: deployer, log: true }, 'transferOwnership', governance);
}
}
};
module.exports = func;
Expand Down
Loading

0 comments on commit 0895fe6

Please sign in to comment.