Order of layout is wrong in ERC20Patched.sol #11
Labels
0 (Non-critical)
Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation
bug
Something isn't working
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
aga7hokakological
Vulnerability details
Impact
Layout of contract elements should be in following order:
Pragma statements > Import statements > Interfaces > Libraries > Contracts
Proof of Concept
library Roles {
struct Role {
mapping (address => bool) bearer;
}
}
// File @openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol@v4.2.0
/**
@dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
need to send a transaction, and thus is not required to hold Ether at all.
/
interface IERC20PermitUpgradeable {
/*
value
as the allowance ofspender
overowner
's tokens,owner
's signed approval.spender
cannot be the zero address.deadline
must be a timestamp in the future.v
,r
ands
must be a validsecp256k1
signature fromowner
owner
's current nonce (see {nonces}).*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
owner
. This value must beowner
's nonce by one. This*/
function nonces(address owner) external view returns (uint256);
/**
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
Tools Used
Manual analysis
The text was updated successfully, but these errors were encountered: