Skip to content

Commit

Permalink
Merge pull request #82 from UniverseXYZ/development
Browse files Browse the repository at this point in the history
Merge DEV into Master
  • Loading branch information
wfm-slava authored Jul 16, 2021
2 parents 33d648b + 811563f commit da97b06
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
REACT_APP_CONTRACT_DAO_GOVERNANCE_ADDR: '0xa8047C2a86D5A188B0e15C3C10E2bc144cB272C2'
REACT_APP_CONTRACT_DAO_BARN_ADDR: '0x7b86600211e62B597E7CEA03476b9EFEb6872962'
REACT_APP_CONTRACT_DAO_REWARD_ADDR: '0xF306Ad6a3E2aBd5CFD6687A2C86998f1d9c31205'
REACT_APP_CONTRACT_MERKLE_DISTRIBUTOR_ADDR: '0x2400bf0a2b50882505480a41Be3c21e878cb9c45'

REACT_APP_DAO_ACTIVATION_THRESHOLD: '50000000'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
REACT_APP_CONTRACT_DAO_GOVERNANCE_ADDR: '0xa8047C2a86D5A188B0e15C3C10E2bc144cB272C2'
REACT_APP_CONTRACT_DAO_BARN_ADDR: '0x7b86600211e62B597E7CEA03476b9EFEb6872962'
REACT_APP_CONTRACT_DAO_REWARD_ADDR: '0xF306Ad6a3E2aBd5CFD6687A2C86998f1d9c31205'
REACT_APP_CONTRACT_MERKLE_DISTRIBUTOR_ADDR: '0x2400bf0a2b50882505480a41Be3c21e878cb9c45'

REACT_APP_DAO_ACTIVATION_THRESHOLD: '50000000'

Expand Down
117 changes: 102 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/merkle-distributor/airdrop-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7156,11 +7156,11 @@
"earnings": "21629"
},
{
"address": "0x35ed54562dDaddD7dd699CDf92128C1d9C1A1529",
"address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"earnings": "21629"
},
{
"address": "0x235B5aC21eE516410300DeC89F9ed413cB5d948C",
"address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"earnings": "21629"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ const TreasuryHoldings: React.FC = () => {

if (state.tokens.ethBalance) {
const amountUSD = convertTokenInUSD(state.tokens.ethBalance, EthToken.symbol);
sum.plus(amountUSD ?? 0);
sum = sum.plus(amountUSD ?? 0);
}

return state.tokens.items.reduce((a, item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import Spin from 'components/antd/spin';
import Grid from 'components/custom/grid';
import { Text } from 'components/custom/typography';
import { XyzToken } from 'components/providers/known-tokens-provider';
import config from 'config';
import BalanceTree from 'merkle-distributor/balance-tree';
import { useWallet } from 'wallets/wallet';

import airdropData from '../../../../merkle-distributor/airdrop-test.json';

export type AirdropModalProps = ModalProps & {
merkleDistributor?: MerkleDistributor;
};
Expand All @@ -29,7 +28,11 @@ const AirdropModal: FC<AirdropModalProps> = props => {
const merkleDistributorContract = merkleDistributor;

const tree = useMemo(() => {
const airdropAccounts = airdropData.map(drop => ({
let airdropData;
config.isDev
? (airdropData = require(`../../../../merkle-distributor/airdrop-test.json`))
: (airdropData = require(`../../../../merkle-distributor/airdrop.json`));
const airdropAccounts = airdropData.map((drop: { address: any; earnings: any }) => ({
account: drop.address,
amount: BigNumber.from(FixedNumber.from(drop.earnings)),
}));
Expand Down
11 changes: 7 additions & 4 deletions src/web3/merkleDistributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber, FixedNumber } from 'ethers';
import { AbiItem } from 'web3-utils';
import Web3Contract, { createAbiItem } from 'web3/web3Contract';

import airdropData from '../merkle-distributor/airdrop-test.json';
import config from 'config';

const ABI: AbiItem[] = [
createAbiItem('isClaimed', ['uint256'], ['bool']),
Expand All @@ -27,12 +27,15 @@ export default class MerkleDistributor extends Web3Contract {
this.adjustedAmount = undefined;
this.emit(Web3Contract.UPDATE_DATA);
}

const airdropAccounts = airdropData.map(drop => ({
let airdropData;
config.isDev
? (airdropData = require(`../merkle-distributor/airdrop-test.json`))
: (airdropData = require(`../merkle-distributor/airdrop.json`));
const airdropAccounts = airdropData.map((drop: { address: any; earnings: any }) => ({
account: drop.address,
amount: BigNumber.from(FixedNumber.from(drop.earnings)),
}));
this.claimIndex = airdropAccounts.findIndex(o => o.account === this.account);
this.claimIndex = airdropAccounts.findIndex((o: { account: string | undefined }) => o.account === this.account);
this.claimAmount = this.claimIndex !== -1 ? this.getClaimAmount(this.account || '', airdropData) : undefined;
this.adjustedAmount = undefined;
});
Expand Down

0 comments on commit da97b06

Please sign in to comment.