I followed the YouTube Tutorial on how to setup the boilerplate code and the wallet is not popping up to deduct, even after putting the smart contract. What did I do wrong?
Any error in the console ?
And be sure to execute the function ?
I donāt mind having a meeting to show you my code base and we try to figure it out together. This is the last issue holding the project from launching.
Could you mention the boilerplate that you are using.
And also, the ādonate buttonā function call to see what is the code driving the transaction.
Thanks
I am using the ethereum-boilerplate and here is my code
async function donation(val) {
let bidaVal = (val * 25000000) / 6500;
setBidaValue(bidaVal)
console.log(`value now is ${val}`);
console.log(`the wallet address is ${address}`);
console.log(`the bida amount is ${bidaVal}`);
let options = {
contractAddress: "0x24c8dbf49b822f4cf77738275e4749aac541729e",
functionName: "transfer",
abi: [{ "constant": false, "inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transfer", "outputs": [{ "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }],
params: {
_to: "0x9AD904eb32E652F72afbc6d53B3F489a4EC9fbd1",
_value: Moralis.Units.ETH(val)
},
msgValue: Moralis.Units.ETH(val)
}
await contractProcessor.fetch({
params: options,
onSuccess: () => {
let secondsToGo = 3;
const modal = Modal.success({
title: "Success!",
content: `Your Private Sale purchase with ${val} BNB was Successful. After this presale, we will send your BIDA to this address used for the Presale. Follow our telegram community to stay up to date!`
});
setTimeout(() => {
modal.destroy();
}, secondsToGo * 1000)
finalizeWithFirebase();
}
});
}
Iām trying to run it on binance test net
Check if BSC ( Testnet ) is included in your server EVM config
You mean my Moralis server? If thatās what you meant, I did set it up for BSC testnet.
Kindly drop your code if possible
Here you go https://github.com/5ran6/bidAuctionPresale
dev branch. Or you could checkout to another branch. Thanks. This issue has really been confusing me for days.
Have you been able to access it?
Yes I have.
Going through the code, I noticed your options is not valid. Thats what I can tell yet as I donāt know the chain actually, but looking at the abi you commented below, it doesnāt match match the options.
Your initial options:
{
contractAddress: "0x24c8dbf49b822f4cf77738275e4749aac541729e",
functionName: "transfer",
abi: [
{
constant: false,
inputs: [
{ name: "_to", type: "address" },
{ name: "_value", type: "uint256" },
],
name: "transfer",
outputs: [{ name: "", type: "bool" }],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
],
params: {
_to: "0x9AD904eb32E652F72afbc6d53B3F489a4EC9fbd1",
_value: Moralis.Units.ETH(val),
},
msgValue: Moralis.Units.ETH(val),
}
What I resolved to after checking the abi you commented below
let options = {
contractAddress: "0x24c8dbf49b822f4cf77738275e4749aac541729e",
functionName: "transfer",
abi: [
{
"constant": false,
"inputs": [
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "transfer",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
],
params: {
recipient: "0x9AD904eb32E652F72afbc6d53B3F489a4EC9fbd1",
amount: Moralis.Units.ETH(val),
},
}
Will be fine if you can drop your contract address and the chain too so for some clarification.
Wow. Thanks . So I basically want a verified contract for basic donation (testnet and main net). Which would you recommend?