Not a member yet? Why not Sign up today
Create an account  

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spot the vuln - Challenge 1

#1
Photo 

Please login or register to view this content

Reply

#2
how to contact you?
[Image: 1f40194f13006add380b7f0e07199ad0.gif]
Reply

#3
(02-16-2023, 12:15 PM)BULL Wrote: how to contact you?

Post your answer as reply. I'll check the time to award the first one to answer.
Reply

#4
function _approve(address owner, address spender, uint256 amount) internal virtual {
    require(spender != address(0), "ERC20: approve from the zero address");
    require(owner != address(0), "ERC20: approve to the zero address");
    _allowances[owner][spender] += amount;
    emit Approval(owner, spender, amount);
}
[Image: 1f40194f13006add380b7f0e07199ad0.gif]
Reply

#5
The changes I made:

1. Added a comma between spender and uint256 amount in the function signature.

2.Changed the address 6 to 0, which is the correct address for the zero address.

3.Removed the unnecessary single quotes around spender and uint256.

4. Fixed the indexing of _allowances by removing the space between [owner] and [spender].
[Image: 1f40194f13006add380b7f0e07199ad0.gif]
Reply

#6
(02-16-2023, 12:21 PM)BULL Wrote: The changes I made:

1. Added a comma between spender and uint256 amount in the function signature.

2.Changed the address 6 to 0, which is the correct address for the zero address.

3.Removed the unnecessary single quotes around spender and uint256.

4. Fixed the indexing of _allowances by removing the space between [owner] and [spender].

sorry not, I don't even understand all of this claims. can you please elaborate.
Reply

#7
(02-16-2023, 12:18 PM)BULL Wrote: function _approve(address owner, address spender, uint256 amount) internal virtual {
    require(spender != address(0), "ERC20: approve from the zero address");
    require(owner != address(0), "ERC20: approve to the zero address");
    _allowances[owner][spender] += amount;
    emit Approval(owner, spender, amount);
}

This is same code ,I don't see a difference.
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)