From b3cdea76c6f2d428ffd393203b854acb355e24e0 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/market/NftItem.vue | 2 +- src/utils/blockchain.ts | 3 ++- src/utils/config_chain.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/market/NftItem.vue b/src/components/market/NftItem.vue index b7fe8d1..c386614 100644 --- a/src/components/market/NftItem.vue +++ b/src/components/market/NftItem.vue @@ -117,8 +117,8 @@ export default class extends Vue { nonce, signature } - const res: any = await buyBox(buyData) await this.bc.increaseAllowance(this.data.coinAddress!, price) + const res: any = await buyBox(buyData) const orderId = res.order_id localStorage.setItem('tmp_presale_order_id', orderId) EventBus.$emit(PRESALE_ORDER_GET, orderId) diff --git a/src/utils/blockchain.ts b/src/utils/blockchain.ts index 1003f09..ff914c3 100644 --- a/src/utils/blockchain.ts +++ b/src/utils/blockchain.ts @@ -207,7 +207,8 @@ export class BlockChain { public async increaseAllowance(address: string, price: string) { const coinInstance: any = await this.getCoinInstance(address) - await coinInstance.methods.increaseAllowance(MALL_ADDRESS, price).send({ gas: 1000000 }) + const res = await coinInstance.methods.increaseAllowance(MALL_ADDRESS, price).send({ gas: 1000000 }) + console.log('increaseAllowance: ', res) } public parsePrice(price: number, decimals: number) { diff --git a/src/utils/config_chain.ts b/src/utils/config_chain.ts index b8bd4d2..a221e60 100644 --- a/src/utils/config_chain.ts +++ b/src/utils/config_chain.ts @@ -287,4 +287,4 @@ export const ERC20ABI = [ } ] -export const MALL_ADDRESS = '0x31F29C9A3D0c1c13C825475aebF0d964b5B47c45' +export const MALL_ADDRESS = '0x40ffB0642e0B4494c47b6ad781862C0BDB3256A8'