-
Notifications
You must be signed in to change notification settings - Fork 504
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
PosM: owner-level nonce for permit #139
Conversation
* consolidate using owner, update burn * fix: accrue deltas to caller in increase
* rip out vanilla and benchmark * fix gas benchmark * check posm is the locker before allowing access to external functions * restore execute tests * posm takes as 6909; remove legacy deadcode * restore tests * move helpers to the same file
@@ -96,7 +96,7 @@ contract NonfungiblePositionManager is INonfungiblePositionManager, BaseLiquidit | |||
// mint receipt token | |||
uint256 tokenId; | |||
_mint(owner, (tokenId = nextTokenId++)); | |||
tokenPositions[tokenId] = TokenPosition({owner: owner, range: range}); | |||
tokenPositions[tokenId] = TokenPosition({owner: owner, range: range, operator: address(0x0)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you mint, maybe you should be allowed to specify a default operator? maybe thats wack though lol
contracts/base/ERC721Permit.sol
Outdated
@@ -11,8 +11,7 @@ import {IERC1271} from "../interfaces/external/IERC1271.sol"; | |||
/// @title ERC721 with permit | |||
/// @notice Nonfungible tokens that support an approve via signature, i.e. permit | |||
abstract contract ERC721Permit is ERC721, IERC721Permit { | |||
/// @dev Gets the current nonce for a token ID and then increments it, returning the original value | |||
function _getAndIncrementNonce(uint256 tokenId) internal virtual returns (uint256); | |||
mapping(address owner => uint256 nonce) public nonce; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO natspec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we will not be doing nonce per owner no? We are doing the bitmap I thought
Can you open this against dev-posm? |
Closing in favor of #153 |
in v3, the nonce for
permit
was at the token level and managed byNonfungiblePositionManager
. This was gas-inefficient where a user paid clean / cold-storage writes for each position.in v4, we're putting the nonce at the owner level in
ERC721Permit
-- enabling a one-time cold-storage write, regardless of token / pool.