Skip to content

V1.2.0 - Integrate ERC2612 Permit and Replace Signature points with ByteArray for Burn Function #42

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

Merged
merged 11 commits into from
Mar 7, 2024

Conversation

KristenPire
Copy link
Contributor

ERC2612

  • Adding ERC2612 permit
// StandardController.sol
function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    )
  • Adding getPermitDigest helper
// StandardController.sol
function getPermitDigest(
        address owner,
        address spender,
        uint256 value,
        uint256 nonce,
        uint256 deadline
    ) public view returns (bytes32) 

ERC1271 with ByteArray

  • Replace Signature points (r,s,v) with ByteArray for Burn Function
// MintableController.sol
function burnFrom(
        address from,
        uint256 amount,
        bytes32 h,
        bytes memory signature
    ) public onlySystemAccount(msg.sender) returns (bool)

The revised process significantly alters the token burning mechanism by changing the flow and responsibilities between the Controller and TokenFrontend contracts:

Initial Process:

  1. Monerium's system invokes the burnFrom function on the TokenFrontend contract.
  2. Subsequently, TokenFrontend calls the BurnFrom_WithCaller function on the Controller contract, leading to the tokens being burned.
  3. Following this, TokenFrontend is responsible for emitting the relevant event.

Revised Process:

  1. Monerium's system now directly calls the burnFrom function on the Controller contract, which results in the tokens being burned.
  2. The Controller contract then calls the burnFrom function on the TokenFrontend, triggering the emission of the event.
  3. Lastly, TokenFrontend calls the Controller's burnFrom_WithCaller function, which in this revision, simply returns without performing any action.

Additionals helper and scripts

  • Adding isAdminAccount
  • Adding scripts to deploy, configure and verify tokens.

@KristenPire KristenPire changed the title V1.2.0 V1.2.0 - Integrate ERC2612 Permit and Replace Signature points with ByteArray for Burn Function Feb 12, 2024
@KristenPire KristenPire merged commit bbdacb2 into main Mar 7, 2024
@KristenPire KristenPire deleted the v1.2.0 branch March 7, 2024 08:23
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.

1 participant