Skip to content
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

Update DIOToken.sol #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leonardoanthony
Copy link

Não era possível usar o TransferFrom pois o metodo procurava o address do dono da conta antes do msg.sender.

Por definição o metodo aprove tinha como primeiro parametro o msg.sender, e depois o delegate

function approve(address delegate, uint256 numTokens) public override returns (bool) {
allowed[msg.sender][delegate] = numTokens;

mas o metodo transfer from faz o contrario, como se o owner tivesse o approve do sender, mas na verdade é o contrário

function transferFrom(address owner, address buyer, uint256 numTokens) public override returns (bool) {
require(numTokens <= balances[owner]);
require(numTokens <= allowed[owner][msg.sender]);

Não era possível usar o TransferFrom pois o metodo procurava o address do dono da conta antes do msg.sender.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant