• Register
0 votes
135 views

Problem :

I am new to Etherdelta. I want to deposit the token on Etherdelta from the Myetherwallet wallet but I am facing below error. My token is already created and also my contract is validated. I can send the tokens from my address holding the tokens but if I try to send them from the receiver address, I get the error.

Warning! error encountered during contract execution [bad instruction]”

I am trying to fix this error from past 2 days but still unable to fix it. Can somebody guide me in fixing above error?

8 4 2
2,300 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

I have faced this issue earlier and I know it is very tough for beginners to fix it.

I guess your issue is related to EqualToken it assesses a fee for each transfer, so even if you have already approved EtherDelta to take some number of tokens but the concern here is that you can actually transfer only that number of tokens less your fee, which is I think just 1%.

I can tell you that based on the current balance that you have and a required 1% fee considering them you can still transfer the 29411.1564788 tokens to the EtherDelta. And you can try again with the amount you have.

5 2 1
4,980 points
0 votes

Solution:

recipes is a dynamic storage array. You require to alter the size of the array to include new elements to it. You can either perform this by apparently increasing the length of the array or by shoving a new element into the array.

function addRecipe(uint256 _price, string _name, string _content) public {
    recipes.length++;
    recipes[recipeCount].price = _price;
    recipes[recipeCount].name = _name;
    recipes[recipeCount].content = _content;
    recipes[recipeCount].recipeOwner = msg.sender;

    recipeCount++;
}

Or

function addRecipe(uint256 _price, string _name, string _content) public {
    Recipe memory r;
    r.price = _price;
    r.name = _name;
    r.content = _content;
    r.recipeOwner = msg.sender;

    recipes.push(r);

    recipeCount++;
}

The code is so probably easy that the only issue would appear to be with onlyOwner. I would inspect the value of the owner variable. I bet it's not what you conceive it is. (It's either zero or the value of the sender who opened the contract). You didn't give the address of the contract, so I can't inspect the value of owner on Etherscan. In addition you're not giving the address of the calling account. In case they don't match, the transaction will throw, which (as is true of all Ethereum errors) will report out of gas. In case the code is truly as easy as you tell, the only probable issue is with owner

10 6 4
31,120 points

Related questions

0 votes
1 answer 2 views
2 views
Problem: I have a ERC20 Token on the mainnet of Ethereum. the normal method "transfer" is working finde. I have built another function "performFeelessTransaction" to pay the transactions for everyone. So this function is working fine on Ropsten and Kovan, not ... My Contract is: EIP20.sol: pragma solidity ^0.5.0; How can i find out the reason for the failure?
asked 1 day ago anika11 32k points
0 votes
0 answers 1 view
1 view
Problem: I have a ERC20 Token on the mainnet of Ethereum. the normal method "transfer" is working finde. I have built another function "performFeelessTransaction" to pay the transactions for everyone. So this function is working fine on Ropsten and Kovan, not on mainnet. ... view returns(uint256){ return nonces[msgSender]; } } How can i find out the reason for the failure? Best regards Ruwen
asked 2 days ago Yeamin 21.4k points
0 votes
1 answer 13 views
13 views
Problem: Recently updated to PHP 7.1 and start getting following error Warning: A non-numeric value encountered in on line 29 Any ideas how to tackle this or what it is ?
asked Mar 15 ummesalma 29.2k points
0 votes
1 answer 5 views
5 views
Problem: Please help me to solve it out : warning: something is bad, please clear your cache and restart your browser.
asked Apr 7 rakib1 51.5k points
0 votes
1 answer 13 views
13 views
Any idea?
asked Dec 19, 2020 TeamScript 13.5k points
0 votes
1 answer 1 view
1 view
Problem: I have an issue developing my app on a VM provided by the project owner which is running Windows Server 2016. The problem I'm facing is when developing a WinRT application in Visual Studio 2015 and when working with XAML files - Visual Studio fails to open the visual ... Execute() I can start the app just fine, so the problem is only with the VS editor. Any idea how to solve this problem?
asked 2 days ago Yeamin 21.4k points
0 votes
1 answer 5 views
5 views
Can someone help me with the error message I am getting tat is in valid status 6a80. Check to make sure contract data is on?
asked Apr 4 Sana8989 8.9k points
0 votes
1 answer 2 views
2 views
Problem: My confusion is, does it matter when the ret instruction is called within the procedure/function? Will it always find the correct return address stored on the stack, or must the stack pointer be currently pointing to where the return address was stored? If that's the case, can't we just use push and pop instead of call and ret?
asked 2 days ago Supti 12.7k points
0 votes
1 answer 3 views
3 views
Problem: Does the number of bytes pushed depends on the operand size?
asked Apr 28 salim1 60.6k points