/pol-token

Set of contracts proposed in PIP-17, notably Polygon Ecosystem Token meant as an upgrade to Matic Token.

Primary LanguageSolidityMIT LicenseMIT

Polygon Ecosystem Token (POL)

Test Status

The Polygon Ecosystem Token is intended as an upgrade to the MATIC token. It consists of a token contract, migration contract, and an emission manager contract. Together, this set of contracts is proposed in PIP-17 to Polygon Governance as a step forward in functionality for the polygon ecosystem.

POL Token Contract

POL is broadly based on the MIT-licensed OpenZeppelin ERC-20 implementations which provide support for the default ERC-20 standard, along with some non-standard functions for allowance modifications. The implementation also provides support for EIP-2612: Signature-Based Permit Approvals-style is supported).

The POL token contract is not upgradable.

Source Code

Migration Contract

The migration contract allows 1-to-1 migrations between MATIC and POL using the migrate and unmigrate functions respectively. This migration contract is ownable, and the owner has the ability to disable the ummigrate functionality. For both actions, EIP-2612 Permit-style is supported.

Source Code

Emission Manager Contract

The role of the Emission Manager is to have the exclusive ability to mint new POL tokens. It has the ability to calculate token emissions based upon a yearly rate, and then dispurse them linearly to a configured target StakeManager. For safety, there is a cap on the number of tokens mintable per second as defined by mintPerSecondCap on the token implementation.

A default implementation is included and this contract will be proxy upgradable by Polygon Governance.

Source Code

Development

Setup

  • Install foundry
  • Install Dependencies: forge install
  • Build: forge build
  • Test: forge test

Deployment

Forge scripts are used to deploy or upgrade contracts and an additional extract.js script can be used to generate a JSON and Markdown file with coalesced deployment information. (see deployments)

  1. Ensure .env file is set, cp .env.example

  2. source .env

  3. Deploy using foundry

  • (mainnet): forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --etherscan-api-key $ETHERSCAN_API_KEY
  • (testnet, goerli for example): forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --verifier-url https://api-goerli.etherscan.io/api --chain-id 5
  1. Run node script/util/extract.js <chainId> [version = 1.0.0] [scriptName = Deploy.s.sol] to extract deployment information from forge broadcast output (broadcast/latest-run.json).

Reference Deployments


Copyright (C) 2023 PT Services DMCC