{"id":17794197,"url":"https://github.com/buildonpolygon/zkevm-stb","last_synced_at":"2025-08-13T05:31:24.717Z","repository":{"id":220051236,"uuid":"750635180","full_name":"BuildOnPolygon/zkevm-stb","owner":"BuildOnPolygon","description":"Staking The Bridge by Polygon ZkEVM","archived":false,"fork":false,"pushed_at":"2024-02-23T08:10:21.000Z","size":4237,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-14T18:14:32.770Z","etag":null,"topics":["ethereum","polygon","zkevm"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BuildOnPolygon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T02:28:15.000Z","updated_at":"2024-11-06T22:27:42.000Z","dependencies_parsed_at":"2024-01-31T03:41:18.009Z","dependency_job_id":"9aa6051d-7d10-4d2c-93cb-41ce5cb1ff85","html_url":"https://github.com/BuildOnPolygon/zkevm-stb","commit_stats":null,"previous_names":["pyk/zkevm-erc20-bridge","buildonpolygon/zkevm-stb"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildOnPolygon%2Fzkevm-stb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildOnPolygon%2Fzkevm-stb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildOnPolygon%2Fzkevm-stb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildOnPolygon%2Fzkevm-stb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BuildOnPolygon","download_url":"https://codeload.github.com/BuildOnPolygon/zkevm-stb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229737479,"owners_count":18116456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","polygon","zkevm"],"created_at":"2024-10-27T11:15:27.001Z","updated_at":"2024-12-14T18:15:07.538Z","avatar_url":"https://github.com/BuildOnPolygon.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Staking The Bridge by Polygon ZkEVM\n\nSource code for Staking The Bridge project by Polygon ZkEVM.\n\n## Contracts\n\n### L1Escrow\n\n- L1Escrow receive ERC-20 from users on L1 and trigger a mint of the L2Token on L2\n  via LxLy bridge.\n- L1Escrow hold the backing for ERC-20 and contain the investment logic.\n- L1Escrow is upgradable.\n- Roles:\n  - **Admin**\n    - Ability to upgrade the contract\n    - Ability to pause the contract\n    - Ability to grant/revoke roles\n  - **EscrowManager**\n    - Ability to withdraw ERC-20 tokens from backing\n- Follow the ERC-20 Mintable Interface supported by Polygon Portal\n\n### L2Token\n\n- This contract is the ERC-20 on L2.\n- L2Token is upgradable.\n- Roles:\n  - **Admin**\n    - Ability to upgrade the contract\n    - Ability to pause the contract\n    - Ability to grant/revoke roles\n  - **Escrow**\n    - Ability to mint and burn token via `bridgeMint` and `bridgeBurn`\n  - **Converter**\n    - Ability to mint and burn token via `converterMint` and `converterBurn`\n\n### L2Escrow\n\n- This contract is responsible for receive cross-chain message from\n  L1Escrow then mint L2Token\n- L2Escrow receive L2Token from users on L2 and trigger a release of the TKN\n  on L1 via LxLy.\n- L2Escrow is upgradable.\n- Roles:\n  - **Admin**\n    - Ability to upgrade the contract\n    - Ability to pause the contract\n- Follow the ERC-20 Mintable Interface supported by Polygon Portal\n\n### L2TokenConverter\n\n- User can deposit ERC-20 to L2TokenConverter in exchange for L2Token via `deposit`\n- User can withdraw ERC-20 by burning L2Token via `withdraw`\n- L2TokenConverter is upgradable.\n- Roles:\n  - **Admin**\n    - Ability to upgrade the contract\n    - Ability to pause the contract\n    - Ability to grant/revoke roles\n  - **EscrowManager**\n    - Ability to withdraw ERC-20 tokens\n  - **RiskManager**\n    - Ability to change issue cap\n- Escrow manager can withdraw the ERC-20 inside L2TokenConverter via `managerWithdraw`\n  function\n- Risk manager can increase or reduce the issuance cap of the ERC-20 \u003c-\u003e L2Token\n  via `setIssuanceCap`\n\n## Development\n\nInstall latest version of [foundry](https://github.com/foundry-rs/foundry).\n\nInstall dependencies:\n\n```shell\nforge install\n```\n\nCreate `.env` file with the following content:\n\n```shell\nETH_RPC_URL=\"https://ethereum.publicnode.com\"\nZKEVM_RPC_URL=\"https://zkevm-rpc.com\"\n```\n\nRun the test:\n\n```shell\nforge test\n```\n\nGet the storage location addresses:\n\n```shell\nforge script StorageLocationScript\n```\n\n## Deployment\n\nThis contract is depends on [CREATE3Factory](https://github.com/ZeframLou/create3-factory)\nmake sure it get deployed on source and target chain with the same address.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildonpolygon%2Fzkevm-stb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildonpolygon%2Fzkevm-stb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildonpolygon%2Fzkevm-stb/lists"}