Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy V3 #562

Merged
merged 7 commits into from
May 20, 2024
Merged
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
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 @@ -173,10 +173,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", // USDC
Expand All @@ -189,7 +189,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"mainnet": {
"governance": "0xBA5Ddb6Af728F01E91D77D12073548D823f6D1ef",
Expand All @@ -198,10 +200,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
Expand All @@ -214,7 +216,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"optimism": {
"governance": "0x5A6910528b047d3371970dF764ba4046b7DfAd6a",
Expand All @@ -223,10 +227,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", // USDC
Expand All @@ -239,7 +243,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"arbitrum": {
"governance": "0x022B95b4c02bbA85604506E6114485615b0aD09A",
Expand All @@ -248,10 +254,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", // USDC
Expand All @@ -264,7 +270,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"bnb": {
"governance": "0xbFBC2Ab80bD0A12258db952739238e403Be01ece",
Expand All @@ -273,10 +281,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", // USDC
Expand All @@ -289,7 +297,9 @@ module.exports = {
"merkleTreeIPFSRef": "",
"root": null,
"deadline": null
}
},
"deployHackersNFT": false,
"deployVaultsNFT": false
},
"base": {
"governance": "0x5c9d8Fd82a5F0E73384cdfe338ba25F346EEA391",
Expand All @@ -298,10 +308,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0x4200000000000000000000000000000000000006", // WETH
Expand All @@ -323,10 +333,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "NEED ADDRESS", // USDC
Expand All @@ -348,10 +358,10 @@ module.exports = {
"0xfe46D9193BBCE8c590298d77b6f8dB0e619c7FF7",
"0xe24886AC31c25B544092542aD55aa484FbBF506B",
"0xe707ABbDA8146d2d3f3341E9B375Cb1fc78526d8",
"0x9Fb3d86157a9e2dC2a771C297f88FA9784fa4e31",
"0x335DaFb8e708151e7e91C9Fe6F4AF9755877c205",
"0x2B6656e212f315D3C2DD477FE7EBFb3A86bb1c94",
"0xF6aEF099e4473E08bed75E0BB1252C4cdAd96416",
"0xd714Dd60e22BbB1cbAFD0e40dE5Cfa7bBDD3F3C8"
"0x42eefBC05794e71a0f7e7B63E5EcB52320345eBE"
],
"rewardControllersConf": [],
"hatToken": "0xd86e243fc0007e6226b07c9a50c9d70d78299eb5", // USDC
Expand All @@ -373,7 +383,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
Loading