-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't burn tokens by accessing from contract even after approval #1705
Comments
Yeah, what is the error? |
Could you share your setup in greater detail? Keep in mind that if you call |
Yeah, I've done that. That's why I mentioned transferFrom() works fine. This is the code I'm executing. The token is created with open zeppelin 0.5.2 standard. I've an interface which has burnFrom(). I just don't get it, If transferFroms works in the sense burnFrom() should also work. But its throwing an error.
P.s The user has enough balance and error not occured by require statements. |
Could you share a snippet of how you call |
This comment has been minimized.
This comment has been minimized.
@Skyge to clarify, I was requesting @smrMadhan7 to post a snippet of their contract with the |
Yeah, I also think he should provide more details about his contract, in order to we can quickly help him solve it. |
This is the code used for token.
This is the interface used.
In main contract, I've used the following code. In this transferFrom() works fine, replacing it with burnFrom() throws error.
|
@smrMadhan7 It looks like a standard contract, so I think it will work fine. So if |
@Skyge I too thought the same, but it didn't work. I even went through the code multiple times, nothing seems odd. |
Thanks @Skyge |
@smrMadhan7 We're not giving up on helping you to make this code work. So, to be clear, you're replacing Your code looks very weird for a couple of reasons. Why are you defining your own We can continue this conversation here now, but for future questions like this please join our forum and post over there. 🙂 |
I've helped him out in private, so he closed the issue, the exact reason is that he wrote an interface, it is OK that he gave a return value in a function, but when he rewrote the function, he forgot to give a return value, so it always throws out an error. |
Hello, @Skyge |
Please ask in the OpenZeppelin Forum. |
I'm trying to call burnFrom() in the token from a contract by creating a interface object. After approval transferFrom() works fine whereas an error thrown while calling burnFrom().
for example, I've token X deployed. I'm calling it from an other contract with IERC20 tokenX object.
function burnToken(address _address,uint256 value) public{
Token.burnFrom(_address,value);
}
The text was updated successfully, but these errors were encountered: