ERC721 Cost is giving error

Hello everyone,
I am having an issue with my deployed contract on Rinkeby testnet, when set cost more then zero it is giving me error while minting, my contract address is as bellow:

When i set cost as:
uint256 public cost = 0 ether;
It is perfectly fine and there is error coming, as soon as i set something like:
uint256 public cost = 0.1 ether;
It start showing me error, can anyone help me where thing goes wrong in the code.

Thanks in advance
NomanHaq

:1234: Code to reproduce


:computer: Environment

1 Like

can you show the error?

the error you may notice is that if you try to update the cost value passing 0.1dara error, because you have to enter the value in wei to update from 0 to 0.1 you have to pass the value in wei that will be 0.1 ether = 100000000000000000 wei

It is also a good practice to make the required return an abvertion, to know where the errors are.

Hello dear,

I did the same like:

uint256 public cost = 100000000000000000 ether;

and it gives me following error:
Transaction Error. Exception thrown in contract code.

Can you please suggest?

Regards,

Disculapa and do you have that amount of ether to perform that minteo? If you read correctly I said 100000000000000000 wei no ether, but I'm going to test your contract

The contract works perfectly I made 2 mint, successfully with two accounts the owner and a buyer, which leads me to deduce that you do not have enough ether to make the transaction or you are sending the wrong amount of ether

contract implemented by me 0x7e7c8C7Cfd4C218f62c9AF6afAfD7867BEAC9f88

1 Like

@asmel
Thanks for your reply i can see you are able to mint directly from contract but at application level my minting transactions gets failed.

Is there any possibility if we can zoom in tomorrow at any suitable time?

Regards,