The only changes made to existing widely-utilized wrapped AVAX contract was to change the decimals to 8, and token name to HBAR. It is an ERC20, not Hedera token. We decided to keep it as ERC20 to not have to modify our existing contracts.
Contract versions were bumped to 0.6.12
. This required explicitly marking functions virtual or override. See commit e2138f5215f50769ccc447587d59ff78c9637eff for all changes.
HederaTokenService was integrated to PangolinPair. It will try to associate both reserve tokens, and if association fails, it will assume the token to be ERC20. This simple modification allows a pair to consist of two ERC20 tokens, two Hedera tokens, or one Hedera token and an ERC20 token. See commit 18d552a39e916c52c0606bf894f9cf88d114817a for details.
This is a new contract specifically for Hedera. It creates, mints, and distributes a Hedera native PNG token. It mints an initial supply to be later transferred to an airdrop contract. The remaining tokens are vested based on a hard-coded schedule. The owner first defines recipients and their allocations to receive from the vesting.
The contracts will be deployed to mainnet in the following order.
- Run
npx hardhat run scripts/deploy-WrappedHedera.js
, - Record the new contract ID, and add it to
WRAPPED_HEDERA
in.env
.
Creating a native Hedera mutisig account requires signatures from threshold key holders. The script for this is not ready yet. Once the account is created, set MULTISIGI_ACCOUNT_ID
in .env
accordingly.
- Ensure
MY_PRIVATE_KEY
,MY_ACCOUNT_ID
(Hedera address), andMULTISIG_ACCOUNT_ID
are defined in.env
, - Run
npx hardhat run scripts/deploy-PangolinFactory.js
, - Record the deployed contract ID, and git commit hash.
- Set the
feeTo
address ofPangolinFactory
to the appropriate address (e.g. FeeCollector) using the multisig.
- Ensure appropriate environment variables are set.
- Run
npx hardhat run scripts/getPairHash.js
, and ensure the outputted hash is the same as in line 26 ofcontracts/pangolin-periphery/libraries/PangolinLibrary.sol
. If it is not same, change it accordingly. Note that you should exclude0x
prefix. - Run
npx hardhat run scripts/deploy-PangolinRouter.js
- Ensure
MULTISIG_ACCOUNT_ID
is defined in.env
, - Run
npx hardhat run scripts/deploy-TreasuryVester.js
, - Set recipients (planned: 1800 multisig/team, 2000 community treasury, 6200 PangoChef/farms) using multisig,
- Whenever ready unpause the contract using multisig.
- After airdrop contract is ready and deployed, use
transferInitialSupply
function ofTreasuryVester
to move initial supply to the airdrop contract.
Note that our existing airdrop contract will be re-used. During deployment through hedera-sdk, we will set setMaxAutomaticTokenAssociations
to 1, and transfer a single PNG to trigger the association. Such that we will not need to make changes to our existing contracts.
The rest of the contracts will require no or minimal modification. So they are excluded from this repo. FeeCollector
and CommunityTreasury
will require a restricted associate token function to be able to receive arbitrary Hedera tokens. PangolinStakingPositions
(PNG staking contract, funded by FeeCollector) and PangoChef
(farm rewards distributor, funded by TreasuryVester) will require no change, other than associating PNG during deployment. However, inbetween PangoChef and TreasuryVester, and inbetween PangolinStakingPositions and FeeCollector, there is a need for compatibility contracts, that take the funds from FeeCollector or TreasuryVester, with only purpose to relay them to PangolinStakingPositions and PangoChef, respectively.