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

feat: deploy gOHM/DAI otcOffer #910

Merged
merged 1 commit into from
Nov 27, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// mainnet: OTC_OFFER.DAI_GOHM=0x2c4b131BEf9d676877Ae0b5b2B46914b07FB9272
// yarn hardhat verify --network mainnet 0x2c4b131BEf9d676877Ae0b5b2B46914b07FB9272 --constructor-args scripts/deploys/mainnet/deploymentArgs/0x2c4b131BEf9d676877Ae0b5b2B46914b07FB9272.js
module.exports = [
"0x0ab87046fBb341D058F17CBC4c1133F25a20a52f",
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0x5C8898f8E0F9468D4A677887bC03EE2659321012",
"3096000000000000000000",
0,
"2900000000000000000000",
"3300000000000000000000"
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import '@nomiclabs/hardhat-ethers';
import { ethers } from 'hardhat';
import { OtcOffer__factory } from '../../../../typechain';
import {
deployAndMine,
ensureExpectedEnvvars,
} from '../../helpers';
import { getDeployedContracts } from './contract-addresses';

async function main() {
ensureExpectedEnvvars();
const [owner] = await ethers.getSigners();
const CORE_ADDRESSES = getDeployedContracts();

const factory = new OtcOffer__factory(owner);
await deployAndMine(
'OTC_OFFER.DAI_GOHM',
factory,
factory.deploy,
CORE_ADDRESSES.EXTERNAL.OLYMPUS.GOHM_TOKEN, // user sell token
CORE_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, // user buy token
CORE_ADDRESSES.OTC_OFFER.FUNDS_OWNER, // fundsOwner
ethers.utils.parseEther("3096"), // initial offerPrice -- always 18 dp
0, // offerPricingToken == DAI (USER_BUY_TOKEN)
ethers.utils.parseEther("2900"), // minOfferPrice
ethers.utils.parseEther("3300"), // maxOfferPrice
);

}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function main() {

// Transfer ownership to the multisig
await mine(CORE_INSTANCES.OTC_OFFER.DAI_OHM.transferOwnership(CORE_ADDRESSES.CORE.CORE_MULTISIG));
await mine(CORE_INSTANCES.OTC_OFFER.DAI_GOHM.transferOwnership(CORE_ADDRESSES.CORE.CORE_MULTISIG));
}

// We recommend this pattern to be able to use async/await everywhere
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface ContractAddresses {

OTC_OFFER: {
DAI_OHM: string,
DAI_GOHM: string,
FUNDS_OWNER: string,
}

Expand All @@ -19,6 +20,7 @@ export interface ContractAddresses {
},
OLYMPUS: {
OHM_TOKEN: string,
GOHM_TOKEN: string,
},
}
}
Expand All @@ -31,6 +33,7 @@ const CORE_DEPLOYED_CONTRACTS: {[key: string]: ContractAddresses} = {
},
OTC_OFFER: {
DAI_OHM: '0x687A4B0Ac18Ed3796D55E6A1d747bD75591a8bac',
DAI_GOHM: '0x2c4b131BEf9d676877Ae0b5b2B46914b07FB9272',
FUNDS_OWNER: '0x5C8898f8E0F9468D4A677887bC03EE2659321012',
},
EXTERNAL: {
Expand All @@ -39,6 +42,7 @@ const CORE_DEPLOYED_CONTRACTS: {[key: string]: ContractAddresses} = {
},
OLYMPUS: {
OHM_TOKEN: '0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5',
GOHM_TOKEN: '0x0ab87046fBb341D058F17CBC4c1133F25a20a52f',
},
}
},
Expand All @@ -59,13 +63,15 @@ export interface ContractInstances {
},
OTC_OFFER: {
DAI_OHM: OtcOffer,
DAI_GOHM: OtcOffer,
},
EXTERNAL: {
MAKER_DAO: {
DAI_TOKEN: FakeERC20,
},
OLYMPUS: {
OHM_TOKEN: FakeERC20CustomDecimals,
OHM_TOKEN: FakeERC20CustomDecimals, // 9DP
GOHM_TOKEN: FakeERC20, // 18DP
},
},
}
Expand All @@ -79,13 +85,15 @@ export function connectToContracts(owner: Signer): ContractInstances {
},
OTC_OFFER: {
DAI_OHM: OtcOffer__factory.connect(CORE_ADDRESSES.OTC_OFFER.DAI_OHM, owner),
DAI_GOHM: OtcOffer__factory.connect(CORE_ADDRESSES.OTC_OFFER.DAI_GOHM, owner),
},
EXTERNAL: {
MAKER_DAO: {
DAI_TOKEN: FakeERC20__factory.connect(CORE_ADDRESSES.EXTERNAL.MAKER_DAO.DAI_TOKEN, owner),
},
OLYMPUS: {
OHM_TOKEN: FakeERC20CustomDecimals__factory.connect(CORE_ADDRESSES.EXTERNAL.OLYMPUS.OHM_TOKEN, owner),
GOHM_TOKEN: FakeERC20__factory.connect(CORE_ADDRESSES.EXTERNAL.OLYMPUS.GOHM_TOKEN, owner),
},
},
}
Expand Down
Loading