if redeemable.recipient is zero, the redeemable doesn't exist
This commit is contained in:
parent
eb980ce1a2
commit
a3e988a419
|
@ -5,6 +5,7 @@ import IERC20Detailed from '../embarkArtifacts/contracts/IERC20Detailed';
|
|||
import IERC721Metadata from '../embarkArtifacts/contracts/IERC721Metadata';
|
||||
import { config } from "../config";
|
||||
import { Dispatch } from 'redux';
|
||||
import { ZERO_ADDRESS } from "../utils";
|
||||
|
||||
export const ERROR_REDEEMABLE_NOT_FOUND = "ERROR_REDEEMABLE_NOT_FOUND";
|
||||
export interface ErrRedeemableNotFound {
|
||||
|
@ -180,7 +181,7 @@ export const loadRedeemable = (bucketAddress: string, recipientAddress: string)
|
|||
bucket.methods.expirationTime().call().then((expirationTime: number) => {
|
||||
bucket.methods.redeemables(recipientAddress).call().then((result: any) => {
|
||||
const { recipient, data, code } = result;
|
||||
if (data === "0") {
|
||||
if (recipient === ZERO_ADDRESS) {
|
||||
dispatch(redeemableNotFound())
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import {
|
|||
export const KECCAK_EMPTY_STRING = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";
|
||||
export const KECCAK_EMPTY_STRING2 = sha3(KECCAK_EMPTY_STRING);
|
||||
|
||||
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
||||
|
||||
export const toBaseUnit = (fullAmount: string, decimalsSize: number, roundDecimals: number) => {
|
||||
const amount = new BN(fullAmount);
|
||||
const base = new BN(10).pow(new BN(decimalsSize));
|
||||
|
|
Loading…
Reference in New Issue