Skip to content

Commit

Permalink
chore: deduplicate Upgradable docs and examples (#80)
Browse files Browse the repository at this point in the history
* Remove Upgradable examples

* Extend `Upgradable` docs

* Update README
  • Loading branch information
mooori authored and birchmd committed Feb 20, 2023
1 parent c15787d commit dcd4533
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 421 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Documentation of all methods provided by `Pausable` is available in the [definit

Allows a contract to be upgraded by owner without having a Full Access Key.

Contract example using _Upgradable_ plugin. Note that it requires the contract to be Ownable.
Using the `Upgradable` plugin requires a contract to be `Ownable`.

```rust
#[near_bindgen]
Expand All @@ -82,10 +82,11 @@ impl Counter {
}
```

To upgrade the contract first call `up_stage_code` passing the binary as first argument serialized as borsh. Then call `up_deploy_code`.
This functions must be called from the owner.
To upgrade the contract first call `up_stage_code` passing the binary as first argument serialized as borsh. Then call `up_deploy_code`. Both functions must be called by the owner of the contract.

Documentation of all methods provided by the derived implementation of `Upgradable` is available in the [definition of the trait](/near-plugins/src/upgradable.rs). More examples and guidelines for interacting with an `Upgradable` contract can be found [here](/examples/upgradable-examples/README.md).
[This contract](/near-plugins/tests/contracts/upgradable/src/lib.rs) provides an example of using `Upgradable`. It is compiled, deployed on chain and interacted with in [integration tests](/near-plugins/tests/upgradable.rs).

Documentation of all methods provided by `Upgradable` is available in the [definition of the trait](/near-plugins/src/upgradable.rs).

### [AccessControllable](/near-plugins/src/access_controllable.rs)

Expand Down
2 changes: 0 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
members = [
"full-access-key-fallback-examples/full_access_key_fallback_base",
"near-plugins-test-utils",
"upgradable-examples/upgradable_base",
"upgradable-examples/up_stage_code",
]
223 changes: 0 additions & 223 deletions examples/upgradable-examples/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions examples/upgradable-examples/up_stage_code/Cargo.toml

This file was deleted.

54 changes: 0 additions & 54 deletions examples/upgradable-examples/up_stage_code/src/main.rs

This file was deleted.

24 changes: 0 additions & 24 deletions examples/upgradable-examples/upgradable_base/Cargo.toml

This file was deleted.

10 changes: 0 additions & 10 deletions examples/upgradable-examples/upgradable_base/build.sh

This file was deleted.

Loading

0 comments on commit dcd4533

Please sign in to comment.