Skip to content

Instantly share code, notes, and snippets.

@Teepheh-Git
Created June 25, 2025 16:46
Show Gist options
  • Select an option

  • Save Teepheh-Git/e5d927ce0c8ce620469409216a493ba1 to your computer and use it in GitHub Desktop.

Select an option

Save Teepheh-Git/e5d927ce0c8ce620469409216a493ba1 to your computer and use it in GitHub Desktop.
const rOptimal = BigNumber.from(Math.floor(Number(rewardData?.rOptimal)));
const maximumRLimit = await getPercentileData(rOptimal, general_settings.maximumRLimit);
const notifyRewardAmount = await getPercentileData(
BigNumber.from(Math.ceil(Number(rewardData?.totalSupply))),
general_settings.notifyRewardAmount
);
const notifyMeAmount = await getPercentileData(
BigNumber.from(Math.ceil(+rewardData.rewardValueInDollars / +general_settings.meTokenValue)),
general_settings.notifyMeTokenAmount
);
const vaultTotalSupplyFromDraft = +rewardData?.totalSupply - +rewardData?.treasurySupply;
try {
await delay(NON_PRODUCTION_PRE_DEPLOY_DELAY);
setProgressStep(0);
const res: any = await deployRewardAndPool({
brandId: getBrandIdHex(BigNumber.from(user_data?.brand?.brandProtocolId)),
descriptionLink: rewardDesc,
name: rewardName,
symbol: rewardTicker,
totalSupplyVault: ethers.utils.parseEther(vaultTotalSupplyFromDraft.toString()),
totalSupplyTreasury: ethers.utils.parseEther(rewardData?.treasurySupply ?? ""),
notifyMeAmount: ethers.utils.parseEther(notifyMeAmount.toString()),
maximumRLimit,
rOptimal,
minimumMeAmountForConversation: ethers.utils.parseEther((general_settings.minimumMeAmountForConversion ?? 0).toString()),
minimumRewardAmountForConversation: ethers.utils.parseEther((general_settings.minimumRewardAmountForConversion ?? 0).toString()),
notifyRewardAmount: ethers.utils.parseEther(notifyRewardAmount.toString()),
persist: true,
GELATO_API_KEY,
OPEN_REWARD_IMPLEMENTATION,
TREASURY,
VAULT,
});
{
"brandId": "0x4d25671d6165e4f3bbe4",
"descriptionLink": "pricinng-staging2 reward",
"name": "prs2",
"symbol": "PRS2",
"totalSupplyVault": {
"type": "BigNumber",
"hex": "0xd02ab486cedc0000"
},
"totalSupplyTreasury": {
"type": "BigNumber",
"hex": "0xd02ab486cedc0000"
},
"notifyMeAmount": {
"type": "BigNumber",
"hex": "0x01d7d843dc3b480000"
},
"maximumRLimit": {
"type": "BigNumber",
"hex": "0x015f90"
},
"rOptimal": {
"type": "BigNumber",
"hex": "0x7530"
},
"minimumMeAmountForConversation": {
"type": "BigNumber",
"hex": "0x00"
},
"minimumRewardAmountForConversation": {
"type": "BigNumber",
"hex": "0x00"
},
"notifyRewardAmount": {
"type": "BigNumber",
"hex": "0x01a055690d9db80000"
},
"persist": true,
"GELATO_API_KEY": "tLvbOTpveeXbzmFCzRqwIbAILcHxSfTl48Wy_Pz3Pm4_",
"OPEN_REWARD_IMPLEMENTATION": "0x3a72142d3a691Fac1B4adC5927027e27E8C2b0Fc",
"TREASURY": "0xa807cA3eD074176D0903150bED12CadC45Cd801A",
"VAULT": "0x027cdB2edC79F51E02C238e18054c59476e151e9"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment