Skip to content

Commit

Permalink
Merge branch 'testnet' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
findolor authored Jul 4, 2022
2 parents c94efb3 + 7a54362 commit f370b81
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
21 changes: 14 additions & 7 deletions contracts/cw20/merkleAirdrop/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ export interface CW20MerkleAirdropMessages {
hrp?: string,
) => [RegisterMessage, ReleaseEscrowMessage]
depositEscrow: (airdropAddress: string) => DepositEscrowMessage
claim: (
airdropAddress: string,
stage: number,
amount: string,
proof: string[],
signedMessage?: SignedMessage,
) => ClaimMessage
fundWithSend: (recipient: string, amount: string) => FundWithSendMessage
burn: (airdropAddress: string, stage: number) => BurnMessage
withdraw: (airdropAddress: string, stage: number, address: string) => WithdrawMessage
Expand Down Expand Up @@ -199,6 +192,12 @@ export interface WithdrawMessage {
funds: Coin[]
}

export interface FundWithSendMessage {
from_address: string
to_address: string
amount: Coin[]
}

export interface CW20MerkleAirdropContract {
instantiate: (
senderAddress: string,
Expand Down Expand Up @@ -600,6 +599,14 @@ export const CW20MerkleAirdrop = (client: SigningCosmWasmClient, txSigner: strin
}
}

const fundWithSend = (recipient: string, amount: string): FundWithSendMessage => {
return {
from_address: txSigner,
to_address: recipient,
amount: [coin(amount, getNetworkConfig(NETWORK).feeToken)],
}
}

return {
instantiate,
registerAndReleaseEscrow,
Expand Down
4 changes: 4 additions & 0 deletions pages/airdrops/[address]/claim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ const ClaimAirdropPage: NextPage = () => {
setBalance(Number(wallet.balance[0]?.amount))
}, [wallet.balance])

useEffect(() => {
setBalance(Number(wallet.balance[0]?.amount))
}, [wallet.balance])

useEffect(() => {
if (!cw20BaseContract || !cw20TokenAddress) return

Expand Down
13 changes: 13 additions & 0 deletions pages/airdrops/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ const TOKEN_VALUES = [
},
]

const TOKEN_VALUES = [
{
id: 'native',
title: 'Native Token',
subtitle: `This airdrop will use ${getConfig(NETWORK).feeToken.slice(1)} as the token.`,
},
{
id: 'cw20',
title: 'CW20 Token',
subtitle: 'This airdrop will use a custom cw20 token address.',
},
]

type StartEndValue = 'null' | 'height' | 'timestamp'

type TokenValue = 'native' | 'cw20'
Expand Down

0 comments on commit f370b81

Please sign in to comment.