• Mark Tyneway's avatar
    contracts-bedrock: update weth98 (#10102) · c8277f3b
    Mark Tyneway authored
    * contracts-bedrock: update weth98
    
    The custom gas token project is moving away from using
    the original weth9 code as a predeploy to using the
    weth98 code as a predeploy. As part of this, the ability
    to override the name and symbol are required for chains
    that use a custom gas token. There is no way to
    mark an inline declaration as `virtual`, it requires
    moving to a `function` syntax. Definitely less clean
    looking but necessary to support the override ability.
    
    The implementation of the new WETH predeploy is as follows:
    
    ```solidity
    contract WETH is WETH98 {
        /// @notice Returns the name of the token from the L1Block contract
        function name() external view override returns (string memory) {
            return string.concat("Wrapped ", L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).gasPayingTokenName());
        }
    
        /// @notice Returns the symbol of the token from the L1Block contract
        function symbol() external view override returns (string memory) {
            return string.concat("W", L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).gasPayingTokenSymbol());
        }
    }
    ```
    
    Where when not in custom gas token mode, it with return `Wrapped Ether`
    and `WETH`, so it is backwards compatible.
    
    This commit also adds a fallback function since the original weth9 has
    a fallback function but this one does not. While the receive function
    can work, adding the fallback function ensures that the same behavior
    as weth9 is achieved when making a call that includes calldata + value.
    
    * contracts-bedrock: fix compile
    
    * snapshots: update
    
    * op-bindings: regenerate
    
    * contracts-bedrock: cleanup weth98
    
    * contracts-bedrock: semver lock
    
    * contracts-bedrock: weth98 tests
    
    * lint: fix
    c8277f3b
Name
Last commit
Last update
.changeset Loading commit data...
.circleci Loading commit data...
.github Loading commit data...
.husky Loading commit data...
.vscode Loading commit data...
bedrock-devnet Loading commit data...
cannon Loading commit data...
docs Loading commit data...
endpoint-monitor Loading commit data...
indexer Loading commit data...
op-batcher Loading commit data...
op-bindings Loading commit data...
op-bindings-e2e Loading commit data...
op-bootnode Loading commit data...
op-chain-ops Loading commit data...
op-challenger Loading commit data...
op-conductor Loading commit data...
op-dispute-mon Loading commit data...
op-e2e Loading commit data...
op-heartbeat Loading commit data...
op-node Loading commit data...
op-plasma Loading commit data...
op-preimage Loading commit data...
op-program Loading commit data...
op-proposer Loading commit data...
op-service Loading commit data...
op-ufm Loading commit data...
op-wheel Loading commit data...
ops Loading commit data...
ops-bedrock Loading commit data...
packages Loading commit data...
proxyd Loading commit data...
specs Loading commit data...
ufm-test-services Loading commit data...
.coderabbit.yml Loading commit data...
.dockerignore Loading commit data...
.editorconfig Loading commit data...
.envrc.example Loading commit data...
.eslintrc.js Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.npmrc Loading commit data...
.nvmrc Loading commit data...
.pnpmfile.cjs Loading commit data...
.prettierrc.js Loading commit data...
.semgrepignore Loading commit data...
.shellcheckrc Loading commit data...
.snyk Loading commit data...
CITATION.cff Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
cloudbuild.yaml Loading commit data...
codecov.yml Loading commit data...
docker-bake.hcl Loading commit data...
go.mod Loading commit data...
go.sum Loading commit data...
nx.json Loading commit data...
package.json Loading commit data...
pnpm-lock.yaml Loading commit data...
pnpm-workspace.yaml Loading commit data...
tsconfig.json Loading commit data...
versions.json Loading commit data...