Skip to content

Commit

Permalink
deploy using livenet with cfg (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
zie1ony authored Oct 18, 2024
1 parent b372416 commit bf8b50a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docusaurus/versioned_docs/version-1.0.0/backends/03-casper.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,43 @@ casper-client put-deploy \

For a more in-depth tutorial, please refer to the [Casper's 'Writing On-Chain Code'].

### Example: Deploy with Odra's Livenet

The same can be implemented using the Odra's Livenet interface.

```rust
struct Cfg {
name: String,
is_upgradable: bool,
allow_key_override: bool
}

impl odra::host::OdraConfig for Cfg {
fn package_hash(&self) -> String {
self.name.clone()
}

fn is_upgradable(&self) -> bool {
self.is_upgradable
}

fn allow_key_override(&self) -> bool {
self.allow_key_override
}
}

let env = odra_casper_livenet_env::env();
let result = MyContract::try_deploy_with_cfg(
&env,
NoArgs,
Cfg {
name: "my_contract".to_string(),
is_upgradable: false,
allow_key_override: false
}
);
```

### Example: Deploy ERC721

Odra comes with a standard ERC721 token implementation.
Expand Down

0 comments on commit bf8b50a

Please sign in to comment.