Skip to content

Commit

Permalink
update signature paragraph (#56)
Browse files Browse the repository at this point in the history
* update signature paragraph

* add tx links
  • Loading branch information
YouStillAlive authored Dec 19, 2024
1 parent 2a5bc99 commit 0d191d0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The `DispenserProvider` contract manages token dispensing in collaboration with
- **Events and Notifications:** Emits events for tracking token distributions and errors.

## Use case

Every **IDO** goes through three stages:

1. **Registration.**
Expand All @@ -76,7 +77,9 @@ Currently, the **Registration** stage is managed by the **Backend**, which sends

After the **Participation** stage, the **project owner** receives a list of participants along with their investment information. Based on this data, the total supply of required **IDO** tokens is calculated. The **project owner** then creates a new **dispenser pool** with this total amount, which will be used for distribution.

Every user who has registered and participated in the **IDO** can obtain a signature from the **Backend**, containing data related to their token distribution. The signature is valid for a limited time, can only be used once, and users cannot request multiple signatures. When the **User** receives the signature, they can claim **IDO** tokens using it. As a result, after the `dispenseLock` call, the receiver will receive locked tokens based on the **IDO** conditions.
Every user who has registered and participated in the **IDO** can obtain a signature from the **Backend**, containing data related to their token distribution. The signature is valid for a limited time, can only be used once, and users cannot request multiple signatures. The signature may be **public**. Even if someone else obtains the signature, they cannot use it on their behalf. The signature is bound to the intended recipient, ensuring that only the rightful user can claim the associated tokens. Additionally, the receiver has the option to delegate the `dispenseLock` call to an approved address.

When the **User** receives the signature, they can claim **IDO** tokens using it. As a result, after the `dispenseLock` call, the receiver will receive locked tokens based on the **IDO** conditions.

![DispenserProvider_-_use_case](https://github.com/user-attachments/assets/0cbaef4f-cb9f-4b50-84cc-06cc90e9c987)

Expand Down Expand Up @@ -108,6 +111,10 @@ _This picture illustrates the relationships between actors and processes._
returns (uint256 poolId);
```

**Testnet example call:** [BSC Testnet Transaction](https://testnet.bscscan.com/tx/0xc280793846ae9a205e1e574416054e1088f477ccf7da1bd4710438f9887a6071)

**Function selector:** `0x14877c38`

### Typescript example

To interact with the `createNewPool` function from a TypeScript script, you can use the following example. Ensure you have installed the necessary dependencies such as ethers, hardhat, and appropriate network configuration.
Expand Down Expand Up @@ -139,8 +146,8 @@ To call this function, caller must have the pool owner's signature, be the recip

```solidity
/// @notice Dispenses tokens from a locked pool based on provided data and signature.
/// If the pool owner intends to dispense tokens to himself, using the Withdraw
/// or Split followed by Withdraw option is recommended.
/// If the pool owner intends to dispense tokens to himself, using the Withdraw
/// or Split followed by Withdraw option is recommended.
/// This function supports dispensing tokens to any address specified by the owner.
/// The signature provided is unique and can be used only once
/// @dev Validates the caller's approval, the signature, the availability of tokens, and the lock time before dispensing.
Expand All @@ -159,6 +166,10 @@ To call this function, caller must have the pool owner's signature, be the recip
)
```

**Testnet example call:** [BSC Testnet Transaction](https://testnet.bscscan.com/tx/0x86869217eff90469297574324c0153f3786500ee064e469fd896c3387d3ac7cd)

**Function selector:** `0xda28ff53`

### TypeScript Example

To interact with the dispenseLock function in a TypeScript script, you can use the following example. Ensure that you have the necessary dependencies installed (ethers, hardhat, etc.), and adjust network configurations accordingly.
Expand Down

0 comments on commit 0d191d0

Please sign in to comment.