Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nearuaguild/abstract-dao
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.0
Choose a base ref
...
head repository: nearuaguild/abstract-dao
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.6.1
Choose a head ref
  • 4 commits
  • 7 files changed
  • 2 contributors

Commits on Oct 14, 2024

  1. docs: include response examples of two primary contract functions

    denbite committed Oct 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0711f1c View commit details
  2. fix: include allowed_account_id in response of `register_signature_…

    …request`
    denbite committed Oct 14, 2024
    Copy the full SHA
    3c453e6 View commit details
  3. Release the contract 0.6.1

    denbite committed Oct 14, 2024
    Copy the full SHA
    9456b34 View commit details
  4. Release the contract 0.6.1 (#8)

    🤖 I have created a release *beep* *boop*
    ---
    
    
    ##
    [0.6.1](v0.6.0...v0.6.1)
    (2024-10-14)
    
    
    ### Documentation
    
    * include response examples of two primary contract functions
    ([0711f1c](0711f1c))
    
    
    ### Bug Fixes
    
    * include `allowed_account_id` in response of
    `register_signature_request`
    ([3c453e6](3c453e6))
    
    ---
    This PR was generated with [Release
    Please](https://github.com/googleapis/release-please). See
    [documentation](https://github.com/googleapis/release-please#release-please).
    denbite authored Oct 14, 2024
    Copy the full SHA
    092192d View commit details
Showing with 53 additions and 5 deletions.
  1. +1 −1 .release-please/.manifest.json
  2. +12 −0 CHANGELOG.md
  3. +1 −1 Cargo.lock
  4. +1 −1 Cargo.toml
  5. +36 −2 README.md
  6. +1 −0 src/lib.rs
  7. +1 −0 src/primitives.rs
2 changes: 1 addition & 1 deletion .release-please/.manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.6.0"
".": "0.6.1"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.6.1](https://github.com/nearuaguild/abstract-dao/compare/v0.6.0...v0.6.1) (2024-10-14)


### Documentation

* include response examples of two primary contract functions ([0711f1c](https://github.com/nearuaguild/abstract-dao/commit/0711f1c462d75d094381c862455a91f3fd31e75e))


### Bug Fixes

* include `allowed_account_id` in response of `register_signature_request` ([3c453e6](https://github.com/nearuaguild/abstract-dao/commit/3c453e652c085745e6a429ad901829b4a9f1b449))

## [0.6.0](https://github.com/nearuaguild/abstract-dao/compare/v0.5.0...v0.6.0) (2024-10-14)


2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
description = "Abstract DAO brings Chain Abstraction for multiple chains"
edition = "2021"
name = "near_abstract_dao"
version = "0.6.0"
version = "0.6.1"
# NEP-0330 is automatically implemented for all contracts built with https://github.com/near/cargo-near.
# Link to the repository will be available via `contract_source_metadata` view-function.
repository = "https://github.com/nearuaguild/abstract-dao"
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ This is one of the main functions of the contract. It records user's intention t
pub fn register_signature_request(&mut self, request: InputRequest) -> RequestId
```

#### Example
#### Request Example

```bash
near contract call-function as-transaction abstract-dao.testnet register_signature_request json-args '{
@@ -95,6 +95,19 @@ near contract call-function as-transaction abstract-dao.testnet register_signatu
- `<dao-account-id>` is the institution's account for which signature is generated
- Integer arguments must be base64 encoded

#### Response Example

```json
{
"deadline": 1728984746246497739,
"derivation_path": "denbite.testnet-0",
"mpc_account_id": "v1.signer-prod.testnet",
"request_id": 0
}
```

- `deadline` is Unix timestamp in nanoseconds

### `get_signature()`

This is one of the main functions of the contract. It validates predecessor's permissions, converts payload into EIP-1559 transaction, and transmits further to MPC Contract where the signature is created
@@ -103,7 +116,7 @@ This is one of the main functions of the contract. It validates predecessor's pe
pub fn get_signature(&mut self, request_id: RequestId, other_payload: OtherEip1559TransactionPayload) -> Promise
```

#### Example
#### Request Example

```bash
near contract call-function as-transaction abstract-dao.testnet get_signature json-args '{
@@ -120,8 +133,29 @@ near contract call-function as-transaction abstract-dao.testnet get_signature js
- `<eligible-account-id>` must have permission to run `get_signature()`, otherwise it will throw forbidden error
- Prepaid gas must be bigger than 250TGas

#### Response Example

```json
{
"signature": {
"big_r": {
"affine_point": "02D532992B0ECBF67800DB14E04530D9BA55609AD31213CC7ABDB554E8FDA986D3"
},
"recovery_id": 1,
"s": {
"scalar": "40E81711B8174712B9F34B2540EE0F642802387D15543CBFC84211BB04B83AC3"
}
},
"tx": "0x02f85083aa36a702850485034c878517a4eb0789829dd094e2a01146fffc8432497ae49a7a6cba5b9abd71a380a460fe47b1000000000000000000000000000000000000000000000000000000000000a84bc0"
}
```

- `tx` is hex-encoded payload of EIP-1559 transaction
- `signature` is derived by [MPC Contract](https://github.com/near/mpc/tree/develop/chain-signatures/contract) (see this [repository](https://github.com/nearuaguild/multichain-dao-scripts) to understand how it can be easily relayed to the EVM chain)

## Useful Links

- [multichain-dao-scripts](https://github.com/nearuaguild/multichain-dao-scripts) - The script to relay signed EIP-1559 transaction directly to EVM chain
- [cargo-near](https://github.com/near/cargo-near) - NEAR smart contract development toolkit for Rust
- [near CLI](https://near.cli.rs) - Iteract with NEAR blockchain from command line
- [NEAR Rust SDK Documentation](https://docs.near.org/sdk/rust/introduction)
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ impl Contract {
deadline: new_request.deadline,
derivation_path: new_request.derivation_path,
mpc_account_id: self.mpc_contract_id.clone(),
allowed_account_id: new_request.allowed_account_id,
}
}

1 change: 1 addition & 0 deletions src/primitives.rs
Original file line number Diff line number Diff line change
@@ -164,6 +164,7 @@ pub struct RegisterSignatureReqResponse {
pub deadline: Timestamp,
pub derivation_path: String,
pub mpc_account_id: AccountId,
pub allowed_account_id: AccountId,
}

#[near_sdk::near(serializers = [json])]