-
Notifications
You must be signed in to change notification settings - Fork 142
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
OmniFlix NFT (x/onft) staked voting module #838
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoahSaso
force-pushed
the
noah/omniflix
branch
2 times, most recently
from
June 7, 2024 20:49
da9098a
to
829a626
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #838 +/- ##
===============================================
+ Coverage 96.26% 96.53% +0.27%
===============================================
Files 209 229 +20
Lines 53514 60562 +7048
===============================================
+ Hits 51513 58466 +6953
- Misses 2001 2096 +95 ☔ View full report in Codecov by Sentry. |
JakeHartnell
approved these changes
Jul 2, 2024
ismellike
added a commit
to Arena-DAO/dao-contracts
that referenced
this pull request
Jul 19, 2024
commit 0c09c62 Author: Gabriel Lopez <[email protected]> Date: Thu Jul 18 20:56:03 2024 -0500 Revert integration_tests.yml commit c46937a Author: Gabriel Lopez <[email protected]> Date: Wed Jul 17 13:18:11 2024 -0500 Update basic.yml to cache only cargo deps Nightly toolchain is required for integration_tests commit 7773cb0 Author: Gabriel Lopez <[email protected]> Date: Wed Jul 17 12:45:09 2024 -0500 Set integration_tests toolchain to latest stable commit 74aea83 Author: Gabriel Lopez <[email protected]> Date: Thu Jul 11 02:21:52 2024 -0500 Cargo schema + fix orch wasm build and tests commit e8081ac Author: Gabriel Lopez <[email protected]> Date: Thu Jul 11 00:40:32 2024 -0500 Fix cargo stuff commit d5a1850 Merge: 87925b2 5918cbe Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:48:52 2024 -0500 Merge branch 'development' into feature/cw-orch-interface commit 87925b2 Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:47:50 2024 -0500 Add cache to basic.yml commit 2951f8c Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:47:40 2024 -0500 Fix lints Also updates just lint to match basic.yml commit 5918cbe Author: noah <[email protected]> Date: Mon Jul 8 18:33:22 2024 -0400 OmniFlix NFT (x/onft) staked voting module (DA0-DA0#838) commit ac249f4 Author: noah <[email protected]> Date: Sat Jul 6 23:11:22 2024 -0400 Improve pre-propose proposal creation permission granularity (and bump versions to v2.5.0) (DA0-DA0#843) commit 8be18d1 Author: bekauz <[email protected]> Date: Mon Jun 17 18:05:24 2024 +0200 staking rewards distribution followup (DA0-DA0#835) Co-authored-by: Noah Saso <[email protected]> Co-authored-by: Jake Hartnell <[email protected]> commit bb8224e Author: noah <[email protected]> Date: Thu Jun 6 00:32:12 2024 -0400 moved .cargo/config to .cargo/config.toml (DA0-DA0#837) commit 87485be Author: bekauz <[email protected]> Date: Wed May 22 18:39:06 2024 +0200 bump cw-std to 1.5.4 (DA0-DA0#824) commit 8c945ac Author: Kayanski <[email protected]> Date: Fri May 17 09:09:32 2024 +0000 Added other derives commit f720001 Author: Kayanski <[email protected]> Date: Fri May 17 09:06:45 2024 +0000 Added derive fns commit 003f87d Author: Kayanski <[email protected]> Date: Fri May 17 08:54:07 2024 +0000 Fix tests commit 88ec5ed Author: Kayanski <[email protected]> Date: Fri May 17 08:52:54 2024 +0000 Added Queryfns on voting commit 3440d34 Author: Kayanski <[email protected]> Date: Fri May 17 08:06:38 2024 +0000 Finalize test changes commit 9492e37 Author: Kayanski <[email protected]> Date: Fri May 17 07:40:35 2024 +0000 More tests commit 5883c87 Author: Kayanski <[email protected]> Date: Thu May 16 17:24:41 2024 +0000 Added tests with cw-orch commit b01de1c Author: Kayanski <[email protected]> Date: Thu May 16 14:41:02 2024 +0000 First test modifications commit 3ab7017 Author: noah <[email protected]> Date: Mon Apr 1 20:04:11 2024 +0200 Update versions to 2.4.2 (DA0-DA0#817) commit caea80a Author: noah <[email protected]> Date: Mon Apr 1 19:32:50 2024 +0200 support kujira's /kujira.denom... tokenfactory fork (DA0-DA0#816)
ismellike
added a commit
to Arena-DAO/dao-contracts
that referenced
this pull request
Jul 19, 2024
commit aff2c4e Author: Gabe <[email protected]> Date: Fri Jul 19 12:08:16 2024 -0500 Revert basic.yml i think caching is causing issues with the cargo.lock commit 6db4637 Author: Gabe <[email protected]> Date: Fri Jul 19 12:06:17 2024 -0500 Lint + not(target_arch = "wasm32") in lib.rs commit 18241d0 Merge: 761a780 87847fd Author: Gabe <[email protected]> Date: Fri Jul 19 10:58:25 2024 -0500 Merge branch 'pr/1' into feature/cw-orch-interface commit 761a780 Author: Gabe <[email protected]> Date: Fri Jul 19 02:40:02 2024 -0500 Update to cw-orch .24.1 commit 0c09c62 Author: Gabriel Lopez <[email protected]> Date: Thu Jul 18 20:56:03 2024 -0500 Revert integration_tests.yml commit c46937a Author: Gabriel Lopez <[email protected]> Date: Wed Jul 17 13:18:11 2024 -0500 Update basic.yml to cache only cargo deps Nightly toolchain is required for integration_tests commit 7773cb0 Author: Gabriel Lopez <[email protected]> Date: Wed Jul 17 12:45:09 2024 -0500 Set integration_tests toolchain to latest stable commit 87847fd Author: hard-nett <[email protected]> Date: Sat Jul 13 18:53:38 2024 +0000 add cw-orch to external contract commit 74aea83 Author: Gabriel Lopez <[email protected]> Date: Thu Jul 11 02:21:52 2024 -0500 Cargo schema + fix orch wasm build and tests commit e8081ac Author: Gabriel Lopez <[email protected]> Date: Thu Jul 11 00:40:32 2024 -0500 Fix cargo stuff commit d5a1850 Merge: 87925b2 5918cbe Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:48:52 2024 -0500 Merge branch 'development' into feature/cw-orch-interface commit 87925b2 Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:47:50 2024 -0500 Add cache to basic.yml commit 2951f8c Author: Gabriel Lopez <[email protected]> Date: Wed Jul 10 23:47:40 2024 -0500 Fix lints Also updates just lint to match basic.yml commit 5918cbe Author: noah <[email protected]> Date: Mon Jul 8 18:33:22 2024 -0400 OmniFlix NFT (x/onft) staked voting module (DA0-DA0#838) commit ac249f4 Author: noah <[email protected]> Date: Sat Jul 6 23:11:22 2024 -0400 Improve pre-propose proposal creation permission granularity (and bump versions to v2.5.0) (DA0-DA0#843) commit 8be18d1 Author: bekauz <[email protected]> Date: Mon Jun 17 18:05:24 2024 +0200 staking rewards distribution followup (DA0-DA0#835) Co-authored-by: Noah Saso <[email protected]> Co-authored-by: Jake Hartnell <[email protected]> commit bb8224e Author: noah <[email protected]> Date: Thu Jun 6 00:32:12 2024 -0400 moved .cargo/config to .cargo/config.toml (DA0-DA0#837) commit 87485be Author: bekauz <[email protected]> Date: Wed May 22 18:39:06 2024 +0200 bump cw-std to 1.5.4 (DA0-DA0#824) commit 8c945ac Author: Kayanski <[email protected]> Date: Fri May 17 09:09:32 2024 +0000 Added other derives commit f720001 Author: Kayanski <[email protected]> Date: Fri May 17 09:06:45 2024 +0000 Added derive fns commit 003f87d Author: Kayanski <[email protected]> Date: Fri May 17 08:54:07 2024 +0000 Fix tests commit 88ec5ed Author: Kayanski <[email protected]> Date: Fri May 17 08:52:54 2024 +0000 Added Queryfns on voting commit 3440d34 Author: Kayanski <[email protected]> Date: Fri May 17 08:06:38 2024 +0000 Finalize test changes commit 9492e37 Author: Kayanski <[email protected]> Date: Fri May 17 07:40:35 2024 +0000 More tests commit 5883c87 Author: Kayanski <[email protected]> Date: Thu May 16 17:24:41 2024 +0000 Added tests with cw-orch commit b01de1c Author: Kayanski <[email protected]> Date: Thu May 16 14:41:02 2024 +0000 First test modifications commit 3ab7017 Author: noah <[email protected]> Date: Mon Apr 1 20:04:11 2024 +0200 Update versions to 2.4.2 (DA0-DA0#817) commit caea80a Author: noah <[email protected]> Date: Mon Apr 1 19:32:50 2024 +0200 support kujira's /kujira.denom... tokenfactory fork (DA0-DA0#816)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upgrades
cw-multi-test
tov0.20.1
so that we can add custom Stargate query and message handlers to mock Omniflix's x/onft module.dao-voting-onft-staked
This is a basic implementation of an NFT staking contract that supports
OmniFlix's NFT standard:
x/onft.
Staked tokens can be unbonded with a configurable unbonding period. Staked balances can be queried at any arbitrary height by external contracts. This contract implements the interface needed to be a DAO DAO voting module.
Stake process
Unlike the base cw721 smart contract, the x/onft SDK module doesn't support
executing a smart contract on NFT transfer, so the stake process is broken up
into three steps:
PrepareStake
to inform this staking contract of the NFTsthat are about to be staked. This will succeed only if the sender currently
owns the NFT(s).
ConfirmStake
on this staking contract which confirms theNFTs were transferred to it and registers the stake.
In case this process is interrupted, or executed incorrectly (e.g. the sender
accidentally transfers an NFT to the staking contract without first preparing
it), there is also a
CancelStake
action to help recover NFTs. If called by:will be sent back if the staking contract owns them.
be sent to the specified recipient (if the staking contract owns them). if no
recipient is specified but the NFT was prepared, it will be sent back to the
preparer.
The recipient field only applies when the sender is the DAO. In the other cases,
the NFT(s) will always be sent back to the sender. Note: if the NFTs were sent
to the staking contract, but no stake was prepared, only the DAO will be able to
correct this and send them somewhere.
The
PrepareStake
step overrides any previousPrepareStake
calls as long asthe new sender owns the NFT(s) and the first stake was never confirmed (which
should be impossible if someone else now owns the NFT(s)). Thus there is no
combination of messages or steps where someone can stake nor prevent stake when
it would otherwise be valid. A stake is only ever confirmed if it was prepared
and transferred by the same address confirming, and the DAO can always recover
an NFT that accidentally skipped the preparation step.