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

Replace ERC-1155 With ERC-6909 For Multi-Token Accounting #358

Closed
wants to merge 8 commits into from

Conversation

jtriley-eth
Copy link
Contributor

Closes #357

Description of changes

  • Replace ERC-1155 with ERC-6909
  • Replace self-transfer and callback based burn mechanism with burn function
  • Update tests
  • Remove ERC11155Receiver interface

Gas Difference

Computed as cost(ERC6909) - cost(ERC1155).

deploy cost codesize
-799_822 -4395
fn name min avg med max
MAX_TICK_SPACING +22 +22 +22 +22
balanceOf -78 -78 -78 -78
burn* -22697 -22697 -22697 -22697
collectHookFees 0 0 0 0
collectProtocolFees -34 -34 -34 -34
currencyDelta 0 0 0 0
donate 0 0 0 0
getLock +22 +22 +22 +22
getPosition 0 0 0 0
getSlot0 -23 -23 -23 -23
initialize +7 -35 -45 +53
lock -79 +353 -2692 -461
lockData -22 -22 -22 -22
mint +15_601 +15_601 +15_601 +15_601
modifyPosition +20 +754 +20 +5535
pools 0 0 0 0
protocolFeeController 0 0 0 0
protocolFeesAccrued +22 +22 +22 +22
transferFrom* -26_675 -12_609 -8_374 -5_935
setOperator* -33 -33 -33 -33
setHookFees 0 +254 0 0
setProtocolFeeController 0 0 0 0
setProtocolFees 0 -66 0 0
settle +17 +17 +17 +22
swap +21 +21 +16 +21
take -35 -35 -35 -35

Additional Notes

burn

Comparison is between ERC1155.safeTransferFrom and PoolManager.burn.

These are functionally equivalent, though the ERC1155.safeTransferFrom performs an additional
external call to itself for the burn step.

transferFrom

Comparison is between ERC1155.safeTransferFrom and ERC6909.transferFrom.

The ERC1155.safeTransferFrom source is forge test --gas-report before the ERC-6909 migration.

The ERC6909.transferFrom source is forge test --gas-report from the
ERC-6909 repository.

setOperator

Comparison is between ERC1155.setApprovalForAll and ERC6909.setOperator, they are functionally
equivalent.

@snreynolds
Copy link
Member

Closing this in favor of implementing minimal claims interface as described here #379

@zhongeric
Copy link
Contributor

Closing in favor of #422 for now, will re-open the original issue and add more context there

@zhongeric zhongeric closed this Nov 21, 2023
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.

Replace ERC-1155 With ERC-6909 For Multi-Token Accounting
3 participants