Skip to content

Commit

Permalink
Simplify the token timelock example
Browse files Browse the repository at this point in the history
Related to #359

Simplify the token timelock example by renaming, supporting a single claimant, and using a p22 constructor.

* **Renaming:**
  - Rename the folder to `token-timelock`.
  - Rename the contract to `TokenTimelockContract` in `token-timelock/src/lib.rs`.

* **Single Claimant Support:**
  - Update `ClaimableBalance` struct to support a single claimant instead of a vector of claimants in `token-timelock/src/lib.rs`.

* **p22 Constructor:**
  - Replace the `deposit` function with a p22 constructor named `__constructor` in `token-timelock/src/lib.rs`.

* **Time Bound:**
  - Update `TimeBound` struct to only support "valid after" semantics in `token-timelock/src/lib.rs`.

* **Tests:**
  - Update tests to use `TokenTimelockContract` and support a single claimant in `token-timelock/src/test.rs`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/stellar/soroban-examples/issues/359?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
leighmcculloch committed Jan 22, 2025
1 parent dd1c3a5 commit 2bd89cf
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 1,773 deletions.
Loading

0 comments on commit 2bd89cf

Please sign in to comment.