From f260c8fa8435de6db3aa043ddf9e707c83ad0dc3 Mon Sep 17 00:00:00 2001 From: RoviDev Date: Thu, 2 Jul 2026 11:42:22 +0200 Subject: [PATCH] fix(links): use toWei for large send-with-link amounts (Fixes #240) Co-authored-by: Cursor --- src/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 5d197ae3f..0550e30a4 100644 --- a/src/App.js +++ b/src/App.js @@ -1666,8 +1666,9 @@ render() { let randomHash = this.state.web3.utils.sha3(""+Math.random()) let randomWallet = this.state.web3.eth.accounts.create() let sig = this.state.web3.eth.accounts.sign(randomHash, randomWallet.privateKey); + const amountWei = this.state.web3.utils.toWei(String(amount), 'ether') console.log("STATE",this.state,this.state.contracts) - this.state.tx(this.state.contracts.Links.send(randomHash,sig.signature,0,amount*10**18,7),250000,false,amount*10**18,async (receipt)=>{ + this.state.tx(this.state.contracts.Links.send(randomHash,sig.signature,0,amountWei,7),250000,false,amountWei,async (receipt)=>{ this.setState({sendLink: randomHash,sendKey: randomWallet.privateKey},()=>{ console.log("STATE SAVED",this.state) })