Skip to content

Commit

Permalink
Update membership pricing (#4158)
Browse files Browse the repository at this point in the history
* Update membership pricing

* Fix tests

* Bump block num for Hardhat
  • Loading branch information
FrederikBolding authored Oct 7, 2021
1 parent 0a757f0 commit efefb08
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion __tests__/hardhat-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const resetFork = async (stickyBlockNum = true) => {
{
forking: {
jsonRpcUrl: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
blockNumber: stickyBlockNum ? 12651850 : undefined
blockNumber: stickyBlockNum ? 13373860 : undefined
}
}
]);
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config: HardhatUserConfig = {
hardfork: 'london',
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
blockNumber: 12651850
blockNumber: 13373860
},
accounts: {
mnemonic: 'test test test test test test test test test test test ball'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('PurchaseMembershipStepper', () => {
...fAccounts[0],
assets: [
...fAccounts[0].assets,
{ ...fDAI, balance: BigNumber.from('0x22b1c8c1227a00000') }
{ ...fDAI, balance: BigNumber.from('0x15af1d78b58c400000') }
]
}
]
Expand Down
26 changes: 10 additions & 16 deletions src/features/PurchaseMembership/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface IMembershipConfig {
icon: string;
price: string;
networkId: NetworkId;
discount?: string;
assetUUID: string;
durationInDays: number;
discountNotice: string;
Expand Down Expand Up @@ -76,7 +75,7 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0x6cA105D2AF7095B1BCEeb6A2113D168ddDCD57cf',
description: '',
icon: onemonthIcon,
price: '4',
price: '10',
assetUUID: DAIUUID,
durationInDays: 30,
discountNotice: '',
Expand All @@ -89,7 +88,7 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0xcB3BB4CCe15b492E7fdD7cb9a3835C034714207A',
description: '',
icon: onemonthIcon,
price: '4',
price: '10',
assetUUID: XDAIUUID,
durationInDays: 30,
discountNotice: '',
Expand All @@ -102,7 +101,7 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0x54d0be5C24e183EF4247c5C1a426A6838696ED88',
description: '',
icon: onemonthIcon,
price: '4',
price: '10',
assetUUID: USDCPolygonUUID,
durationInDays: 30,
discountNotice: '',
Expand All @@ -116,7 +115,6 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
description: '',
icon: threemonthsIcon,
price: '10.5',
discount: '10',
disabled: true,
assetUUID: DAIUUID,
durationInDays: 90,
Expand All @@ -131,7 +129,6 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
description: '',
icon: sixMonthsIcon,
price: '18',
discount: '20',
disabled: true,
assetUUID: DAIUUID,
durationInDays: 180,
Expand All @@ -145,11 +142,10 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0xee2B7864d8bc731389562F820148e372F57571D8',
description: '',
icon: twelveMonthsIcon,
price: '30',
discount: '40',
price: '100',
assetUUID: DAIUUID,
durationInDays: 366,
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~37.5%' }),
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~16.6%' }),
networkId: DEFAULT_NETWORK
},

Expand All @@ -159,11 +155,10 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0xf97f516Cc0700a4Ce9Ee64D488F744f631e1525d',
description: '',
icon: twelveMonthsIcon,
price: '30',
discount: '40',
price: '100',
assetUUID: XDAIUUID,
durationInDays: 366,
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~37.5%' }),
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~16.6%' }),
networkId: XDAI_NETWORK
},

Expand All @@ -173,11 +168,10 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0x46522c5a1018E13E40e3117191200e4CF6039241',
description: '',
icon: twelveMonthsIcon,
price: '30',
discount: '40',
price: '100',
assetUUID: USDCPolygonUUID,
durationInDays: 366,
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~37.5%' }),
discountNotice: translateRaw('MEMBERSHIP_DISCOUNT', { $percentage: '~16.6%' }),
networkId: POLYGON_NETWORK
},

Expand All @@ -187,7 +181,7 @@ export const MEMBERSHIP_CONFIG: IMembershipConfigObject = {
contractAddress: '0x098D8b363933D742476DDd594c4A5a5F1a62326a',
description: '',
icon: lifetimeIcon,
price: '2',
price: '1',
assetUUID: ETHUUID,
durationInDays: 36500,
discountNotice: translateRaw('MEMBERSHIP_LIFETIME_DESC'),
Expand Down
8 changes: 4 additions & 4 deletions src/features/PurchaseMembership/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('createApproveTx()', () => {
const expected = {
chainId: 1,
data:
'0x095ea7b3000000000000000000000000ee2b7864d8bc731389562f820148e372f57571d8000000000000000000000000000000000000000000000001a055690d9db80000',
'0x095ea7b3000000000000000000000000ee2b7864d8bc731389562f820148e372f57571d80000000000000000000000000000000000000000000000056bc75e2d63100000',
from: '0xfE5443FaC29fA621cFc33D41D1927fd0f5E0bB7c',
gasPrice: '0x3b9aca00',
to: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
Expand All @@ -42,7 +42,7 @@ describe('createPurchaseTx()', () => {
const expected = {
chainId: 1,
data:
'0x3f33133a000000000000000000000000000000000000000000000001a055690d9db80000000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
'0x3f33133a0000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
from: '0xfE5443FaC29fA621cFc33D41D1927fd0f5E0bB7c',
gasPrice: '0x3b9aca00',
to: '0xee2B7864d8bc731389562F820148e372F57571D8',
Expand All @@ -62,7 +62,7 @@ describe('createPurchaseTx()', () => {
const expected = {
chainId: 100,
data:
'0x3f33133a000000000000000000000000000000000000000000000001a055690d9db80000000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
'0x3f33133a0000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
from: '0xfE5443FaC29fA621cFc33D41D1927fd0f5E0bB7c',
gasPrice: '0x3b9aca00',
to: '0xf97f516Cc0700a4Ce9Ee64D488F744f631e1525d',
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('createPurchaseTx()', () => {
const expected = {
chainId: 137,
data:
'0x3f33133a0000000000000000000000000000000000000000000000000000000001c9c380000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
'0x3f33133a0000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000fe5443fac29fa621cfc33d41d1927fd0f5e0bb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
from: '0xfE5443FaC29fA621cFc33D41D1927fd0f5E0bB7c',
gasPrice: '0x3b9aca00',
to: '0x46522c5a1018E13E40e3117191200e4CF6039241',
Expand Down

0 comments on commit efefb08

Please sign in to comment.