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

Proposal re-implement deploy same address feature #26

Open
0xcuonghx opened this issue Sep 20, 2023 · 0 comments
Open

Proposal re-implement deploy same address feature #26

0xcuonghx opened this issue Sep 20, 2023 · 0 comments
Assignees

Comments

@0xcuonghx
Copy link
Collaborator

0xcuonghx commented Sep 20, 2023

Recaps

How Ethereum calculator smart contract address

  1. CREATE opcode
new_address = hash(sender, nonce)
  • Problems:
    • Keep deployer nonce many chains same is impossible and contain risks to manage
  1. CREATE2 opcode
new_address = hash(0xFF, sender, salt, bytecode)
bytecode = contract_code + contract_contructor_args
  • Problems:
    • Cannot upgrade new features or changes
  1. CREATE3
new_address = hash(0xFF, sender, salt, KECCAK256_PROXY_CHILD_BYTECODE)

Proposal

Overview

  • ERC721TokenFactory using CREATE3 to decouple from ERC721NativeToken, ERC721BridgeToken
  • Easy to add new NFT types by mange mapping
  • Remove ERC721TokenProxy
"ERC721NativeToken" -> ERC721NativeToken.bytecode
"ERC721BridgeToken" -> ERC721BridgeToken.bytecode
"OTHER"-> OTHER.bytecode

Specifications

interface IGUFactory {
  deploy(byte32 _salt, byte32 bytecode)
  setType(byte32 type, byte32 bytecode)
}
@0xcuonghx 0xcuonghx self-assigned this Sep 20, 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

No branches or pull requests

1 participant