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

Release/1.1.1 #31

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
24 changes: 13 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Changelog

## v1.1.0 - Purchase DPS with AVAX native token

- Using the new `Sale.purchaseDPSWithAVAX` method, investors can now use the native token to purchase the DeepSquare
token. We hope that this will simplify the investment pipeline.
- The `Sale.purchaseDPS` method has been renamed to `Sale.purchaseDPSWithSTC` to follow the nomenclature.

## v1.0.0 - Initial release

First open source publication of the DeepSquare Association smart contracts, deployed on the Avalanche C-Chain.
# Changelog
## v1.1.1 - Purchase DPS with AVAX native token
- Added script to deploy Sale V5. It's based on Sale V4, which by the way removed the elligility constraint. The price is 0.75 USD.

## v1.1.0 - Purchase DPS with AVAX native token

- Using the new `Sale.purchaseDPSWithAVAX` method, investors can now use the native token to purchase the DeepSquare
token. We hope that this will simplify the investment pipeline.
- The `Sale.purchaseDPS` method has been renamed to `Sale.purchaseDPSWithSTC` to follow the nomenclature.

## v1.0.0 - Initial release

First open source publication of the DeepSquare Association smart contracts, deployed on the Avalanche C-Chain.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deepsquare/smart-contracts",
"version": "1.1.0",
"version": "1.1.1",
"description": "DeepSquare smart contracts running on the Avalanche blockchain",
"keywords": [
"avalanche",
Expand Down
8 changes: 5 additions & 3 deletions scripts/deploy-v4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const addresses: Record<ContractName, Record<NetworkName, string>> = {
PreviousSale: {
hardhat: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
mainnet: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
fuji: '',
fuji: '0x56F09eA30a42351184fC74450aa47860e74488c4',
},
Sale: {
hardhat: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
mainnet: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
fuji: '0xE425D49F421C949F5BE93eE87baEcB607d241dF2',
fuji: '0x721Ae05A95E1Ac7595f526ce5B0c2545fCFe6e97',
},
AggregatorV3: {
hardhat: '0x0A77230d17318075983913bC2145DB16C7366156',
Expand Down Expand Up @@ -104,7 +104,9 @@ async function main() {

await waitTx(Sale.setPause(true));

await waitTx(Sale.transferOwnership(gnosisAddress));
if (networkName === 'mainnet') {
await waitTx(Sale.transferOwnership(gnosisAddress));
}

console.debug('Sale:', Sale.address);
console.debug('Sale.owner()', await Sale.owner());
Expand Down
122 changes: 122 additions & 0 deletions scripts/deploy-v5.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import { ethers, network, run } from 'hardhat';
import { parseEther } from '@ethersproject/units';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import waitTx from '../lib/waitTx';
import { DeepSquare__factory } from '../typings/factories/contracts/DeepSquare__factory';
import { Sale__factory } from '../typings/factories/contracts/Sale__factory';
import { SaleV3__factory } from '../typings/factories/contracts/legacy/v1.2/SaleV3__factory';

// Context: Sale V5 for last week of January 2024.

type NetworkName = 'hardhat' | 'mainnet' | 'fuji';
type ContractName = 'USDC' | 'DeepSquare' | 'Eligibility' | 'PreviousSale' | 'Sale' | 'AggregatorV3' | 'Security';

const addresses: Record<ContractName, Record<NetworkName, string>> = {
USDC: {
hardhat: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
mainnet: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', //Centre: USD Coin or USDC
fuji: '0x868cB9ab1436b071c32C68f0125c54c1eF21b11d',
},
DeepSquare: {
hardhat: '0xf192cae2e7cd4048bea307368015e3647c49338e',
mainnet: '0xf192cae2e7cd4048bea307368015e3647c49338e',
fuji: '0xEeA08029DCcEBAe971039F4B4b2064D466baC2e5',
},
Eligibility: {
hardhat: '0x52088e60AfB56E83cA0B6340B49F709e57973869',
mainnet: '0x52088e60AfB56E83cA0B6340B49F709e57973869',
fuji: '0x3bFB1294843B91139e66D5919102a79e6C9701ee',
},
PreviousSale: {
hardhat: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
mainnet: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
fuji: '0x56F09eA30a42351184fC74450aa47860e74488c4',
},
Sale: {
hardhat: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
mainnet: '0x8c94e12C2d05b2060DF9D9732980bca363F3F58a',
fuji: '0x721Ae05A95E1Ac7595f526ce5B0c2545fCFe6e97',
},
AggregatorV3: {
hardhat: '0x0A77230d17318075983913bC2145DB16C7366156',
mainnet: '0x0A77230d17318075983913bC2145DB16C7366156',
fuji: '0x5498BB86BC934c8D34FDA08E81D444153d0D06aD',
},
Security: {
hardhat: '0x3C603BF311AcFfcd2d4bB2cF14df437D429F1077',
mainnet: '0x3C603BF311AcFfcd2d4bB2cF14df437D429F1077',
fuji: '',
},
};

async function main() {
const networkName = network.name as NetworkName;
const [deployer] = await ethers.getSigners();

const DeepSquareFactory = new DeepSquare__factory(deployer);
const DeepSquare = DeepSquareFactory.attach(addresses.DeepSquare[networkName]);

let gnosis: SignerWithAddress | undefined = undefined;
const gnosisAddress = '0xaEAE6CA5a34327b557181ae1E9E62BF2B5eB1D7F';

console.log('deployer:', deployer.address);
console.log('gnosis:', gnosisAddress);

if (networkName === 'hardhat') {
// The board gives the ownership of the sale to the deployer
gnosis = await ethers.getSigner(gnosisAddress);

await network.provider.request({
method: 'hardhat_setBalance',
params: [deployer.address, parseEther('10').toHexString().replace(/^0x0+/, '0x')],
});
await network.provider.request({
method: 'hardhat_setBalance',
params: [gnosis.address, parseEther('10').toHexString().replace(/^0x0+/, '0x')],
});
}

const SaleFactory = new Sale__factory(deployer);
const saleRate = 75;
const minimumPurchaseStc = 7.5e6;
const initialSold = 0;
const SaleArgs = [
DeepSquare.address,
addresses.USDC[networkName],
addresses.AggregatorV3[networkName],
saleRate,
minimumPurchaseStc,
initialSold,
] as const;
const Sale = await SaleFactory.deploy(...SaleArgs);
await Sale.deployed();

if (networkName === 'mainnet' || networkName === 'fuji') {
await run('verify:verify', {
address: Sale.address,
constructorArguments: SaleArgs,
});
}

if (networkName === 'fuji') {
const previousSale = new SaleV3__factory().attach(addresses.Sale[networkName]);

await waitTx(DeepSquare.transfer(Sale.address, await DeepSquare.balanceOf(previousSale.address)));
}

// No need to pause
// await waitTx(Sale.setPause(true));

if (networkName === 'mainnet') {
await waitTx(Sale.transferOwnership(gnosisAddress));
}

console.debug('Sale:', Sale.address);
console.debug('Sale.owner()', await Sale.owner());
console.debug('Sale.remaining()', await Sale.remaining().then((bn) => bn.toString()));
}

main().catch((e) => {
console.error(e);
process.exit(1);
});
Loading