Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Deploy burn contract by default on EIP-1559 enabled #1648

Merged

Conversation

stana-miric
Copy link
Contributor

@stana-miric stana-miric commented Jun 21, 2023

Description

Context

This PR adds functionality of deploying default burn contract at genesis time if the native token is non mintable.
Burn contract related behavior is following:

1. Mintable native token

it is allowed to specify only 0x0 address for --burn-contract flag in this case. This is because, for mintable native token, default burn contract is not applicable (since tokens originate from the Supernets itself). However we are allowing transfers to 0x0 address (note that as of now, burning tokens would not imply in native token's total supply reduction).

2. Non-mintable native token

only one burn contract can be specified, and that address will be used to deploy the default contract. Also, destination address for default burn contract can be specified in --burn-contract flag and it will be used for initialization of the default contract. If destionation address is not set in --burn-contract flag, default burn contract will be initialized with zero address as a destination address.
If burn contract is not specified, EIP1559 feature will be disabled, london fork will be disabled, BaseFee and BaseFeeEM would not be set, tokens would not be burned.

Later, user can deploy some custom burn contract and update the burn contracts by:

  1. Stoping the node
  2. Changing genesis.json file by:
    2.1 setting the burnContracts using address of a custom deployed contract. Destination address is not needed here since it is only used when predeploying default burn contract at genesis time
    2.2 enabling london fork
  3. Starting the node again

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Please complete this section if you ran manual tests for this functionality, otherwise delete it

Documentation update

Please link the documentation update PR in this section if it's present, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@stana-miric stana-miric added the feature New update to Polygon Edge label Jun 21, 2023
@stana-miric stana-miric requested a review from a team June 21, 2023 21:23
@stana-miric stana-miric self-assigned this Jun 21, 2023
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-715-deploy-burn-contract-by-default-on-1559-enabled branch 3 times, most recently from a975890 to 9ed8f1f Compare June 22, 2023 13:51
@Stefan-Ethernal Stefan-Ethernal changed the title Evm 715 deploy burn contract by default on 1559 enabled Deploy burn contract by default on EIP-1559 enabled Jun 22, 2023
@Stefan-Ethernal Stefan-Ethernal marked this pull request as ready for review June 22, 2023 19:04
@Stefan-Ethernal Stefan-Ethernal requested a review from a team June 22, 2023 19:04
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-715-deploy-burn-contract-by-default-on-1559-enabled branch from 458a21f to c47f504 Compare June 23, 2023 13:23
@goran-ethernal
Copy link
Collaborator

I have some questions here:

  1. Now we can specify only one burn contract in genesis command, but you can deploy more burn contract contracts after you start the child chain, but you will have to change genesis.json? Am I right?
  2. BaseFeeEM and other related EIP-1559 fields will not be set if you don't specify the burn contract, but when you deploy it, stop the node, and change genesis.json file, you will need to specify those fields as well (change them in json file)?

@Stefan-Ethernal
Copy link
Collaborator

I have some questions here:

  1. Now we can specify only one burn contract in genesis command, but you can deploy more burn contract contracts after you start the child chain, but you will have to change genesis.json? Am I right?

Correct.

  1. BaseFeeEM and other related EIP-1559 fields will not be set if you don't specify the burn contract, but when you deploy it, stop the node, and change genesis.json file, you will need to specify those fields as well (change them in json file)?

Correct.

cc @DannyS03 for docs update.

Copy link
Contributor

@vcastellm vcastellm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Stefan-Ethernal Stefan-Ethernal requested a review from a team June 26, 2023 16:41
@Stefan-Ethernal Stefan-Ethernal merged commit 6c6e969 into develop Jun 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2023
@Stefan-Ethernal Stefan-Ethernal deleted the EVM-715-deploy-burn-contract-by-default-on-1559-enabled branch August 18, 2023 10:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants