Timeline for Creating an ICO contract
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 15, 2023 at 4:06 | comment | added | Zartaj Afser | can you paste the updated code and the error you are facing | |
Aug 14, 2023 at 20:22 | comment | added | Santos | ive updated the _forwardFunds function, but the token transfer isnt working | |
Aug 13, 2023 at 5:08 | comment | added | Zartaj Afser |
I see the problem, the reason is msg.value will not be the same for _forwardFunds function, you would need to store that in a variable and then call _forwardFunds function by passing that variable. Because _forwardFunds is not a payable function and it's not receiving any ether, that's why the msg.value is 0.
|
|
Aug 12, 2023 at 14:30 | comment | added | Santos | Yes, you're right. I made a mistake there and it has been updated but still the contract doesn't send the funds to the wallet neither is the ERC20 sent to the buyer, | |
Aug 12, 2023 at 14:23 | comment | added | Zartaj Afser | That's what I am talking about, wallet is an EOA, right? And BNB is not an ERC20 token. So you won't use ERC20 transfer but the solidity transfer function, which sends the BNB to the wallet. And it accepts only one argument. There's a difference between both the transfers. | |
Aug 12, 2023 at 13:36 | comment | added | Santos | when a buyer sends in BNB to the contract to purchase the ICO token, the BNB is sent to the wallet(the _forwardfsFunds) and the _processPurchase, sends the token to the sender | |
Aug 12, 2023 at 13:26 | comment | added | Zartaj Afser |
Wait a minute, I am talking about the transfer function in solidity, which is used to send ether. The ERC20 transfer obviously takes 2 arguments. May I know what wallet means in the _forwardFunds function?
|
|
Aug 12, 2023 at 11:55 | comment | added | Santos | I'm using the IERC20 interface, and the transfer function takes in two arguments, I just tried the single argument and it said it needed two arguments. | |
Aug 12, 2023 at 10:49 | history | answered | Zartaj Afser | CC BY-SA 4.0 |