Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the README's for cross-contract-calls & factory-contract. #1232

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 56 additions & 3 deletions examples/cross-contract-calls/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# Cross contract
# Cross Contract Call

Example of using cross-contract functions with promises.
Example implementation of a cross-contract call using [near-sdk-rs].

TBD
[near-sdk-rs]: https://github.com/near/near-sdk-rs

NOTES:

- This example demonstrates how to call another contract from within a contract.
- Ensure that the called contract is deployed and accessible.

## Project Structure

- `.cargo`: Configuration files for Cargo, the Rust package manager.
- `high-level/src`: Source code for the high-level cross-contract call example.
- `low-level/src`: Source code for the low-level cross-contract call example.
- `res`: Compiled contract binaries.
- `tests`: Integration tests for the cross-contract call examples.

## Building

To build run:

```bash
./build.sh
```

## Testing

To test run:

```bash
cargo test --package cross-contract-call -- --nocapture
```

### Usage

```markdown
## Usage
MattCS2006 marked this conversation as resolved.
Show resolved Hide resolved

1. Deploy the contracts:

- Deploy the high-level contract.
- Deploy the low-level contract.

2. Call the high-level contract to initiate a cross-contract call to the low-level contract.

MattCS2006 marked this conversation as resolved.
Show resolved Hide resolved
## Dependencies

- [near-sdk-rs](https://github.com/near/near-sdk-rs): NEAR Protocol's Rust SDK.
- [Cargo](https://doc.rust-lang.org/cargo/): Rust's package manager.

## Changelog

### `1.0.0`

- Initial implementation of cross-contract call functionality.
```
55 changes: 53 additions & 2 deletions examples/factory-contract/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
# Factory contract
# Factory Contract

TBD
Example implementation of a factory contract using [near-sdk-rs].

[near-sdk-rs]: https://github.com/near/near-sdk-rs

NOTES:

- This example demonstrates how to create and manage multiple instances of a contract from a factory contract.
- Ensure that the factory contract is deployed and accessible.

## Project Structure

- `.cargo`: Configuration files for Cargo, the Rust package manager.
- `high-level/src`: Source code for the high-level factory contract example.
- `low-level/src`: Source code for the low-level factory contract example.
- `res`: Compiled contract binaries.
- `tests`: Integration tests for the factory contract examples.

## Building

To build run:

```bash
./build.sh
```

## Testing

To test run:

```bash
cargo test --package factory-contract -- --nocapture
```

### Usage

```markdown
## Usage

1. Deploy the factory contract.
2. Use the factory contract to create instances of the target contract.

## Dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demonstrate calls to simple_call and complex_call functions.


- [near-sdk-rs](https://github.com/near/near-sdk-rs): NEAR Protocol's Rust SDK.
- [Cargo](https://doc.rust-lang.org/cargo/): Rust's package manager.

## Changelog

### `1.0.0`

- Initial implementation of factory contract functionality.
```
Loading