Deploying a Dumb Contract

Deploying a Dumb Contract

To deploy a new Dumb Contract you send another Ethscription to the null address, this time with "op": "create" instead of "op": "call".

As with the EVM, to ensure Dumb Contract code is always available, it must be stored onchain. This means if you're the first person deploying a specific Dumb Contract you must submit that Dumb Contract's transpiled Rubidity in your dataURI. Fortunately, if at least one person has already deployed a given Dumb Contract you can deploy a new instance by including only a hash of the code in your Ethscription.

Here's an example:

application/vnd.facet.tx+json;rule=esip6,{
    "op": "create",
    "data": {
        "args": {
            "name": "Token0",
            "symbol": "TK0",
            "maxSupply": "1000000000000000000000",
            "perMintLimit": "1000000000000000000000",
            "decimals": 18
        },
        "source_code": "pragma(:rubidity, \"1.0.0\")\ncontract(:ERC20, abstract: true) {\n  event(:Transfe...",
        "init_code_hash": "0xb1b0ed1e4a8c9c9b0210f267137e368f782453e41f622fa8cf68296d04c84c88"
    }
}

You can use the Facet VM to generate transpiled source_code and init_code_hash from Rubidity files.

Supported Dumb Contracts

The Facet Protocol doesn't yet support the execution of arbitrary and untrusted Dumb Contact code. Rather, as we build towards this, it will support a curated list of tested contracts that are contributed by the community as in this example. In the future the protocol will support arbitrary Dumb Contracts.

Last updated