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

feat(contracts): create airdrop vesting contract with manager list #124

Merged
merged 24 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fc5da15
feat: create airdrop vesting contract
matthiasmatt Feb 22, 2024
a69712e
fix: update cookbook
matthiasmatt Feb 22, 2024
182af7d
fix: remove airdrop contract
matthiasmatt Feb 22, 2024
6f2eb7a
feat: add more test coverage
matthiasmatt Feb 22, 2024
5e2cff4
fix: update schema
matthiasmatt Feb 22, 2024
182cea9
feat: add withdraw message
matthiasmatt Feb 22, 2024
5a41b55
fix: fix cookbook
matthiasmatt Feb 23, 2024
c869043
Merge branch 'mat/airdrop-vesting' of github.com:NibiruChain/cw-nibir…
jgimeno Feb 23, 2024
90987c1
fix: make check on instantiation earlier
matthiasmatt Feb 23, 2024
ec8fab9
add comment for some method
jgimeno Feb 23, 2024
248b47f
Merge branch 'mat/airdrop-vesting' of github.com:NibiruChain/cw-nibir…
jgimeno Feb 23, 2024
d84972c
add another comment for validate time
jgimeno Feb 23, 2024
f641efb
add more comments
jgimeno Feb 23, 2024
c3371ae
add refactor
jgimeno Feb 23, 2024
63b13a1
clarify vesting contract code
jgimeno Feb 23, 2024
502efdb
update README for airdrop-token-vesting
jgimeno Feb 23, 2024
1c0668a
fix: remove cw20
matthiasmatt Feb 23, 2024
e0474f2
feat: remove master_address and denom
matthiasmatt Feb 23, 2024
c1846cc
fix: fix readme
matthiasmatt Feb 23, 2024
a770c8f
update readme
jgimeno Feb 26, 2024
b5fb8a6
remove clone
jgimeno Feb 26, 2024
e7a8f52
chore(deps): Cargo.lock update
Unique-Divine Feb 26, 2024
f79a77a
docs(airdrop-token-vesting): add testing script to README
Unique-Divine Feb 26, 2024
5781f19
feat: undo changes to query interface
matthiasmatt Feb 27, 2024
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
83 changes: 16 additions & 67 deletions Cargo.lock

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

79 changes: 79 additions & 0 deletions Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,82 @@ The owner is the only one who can execute messages in the contract
}
}
```
## 7. Core token vesting
matthiasmatt marked this conversation as resolved.
Show resolved Hide resolved

This contract implements vesting accounts for the CW20 and native tokens.

### 7.1 Instantiate

There's no instantiation message.

```javascript
{}
```

### 7.2 Execute

- **Receive**

```javascript
{
"receive": {
"sender": "cosmos1...",
"amount": "1000000",
"msg": "eyJ2ZXN0X2lkIjoxLCJ2ZXN0X3R5cGUiOiJ2ZXN0In0=",
}
}
```

- **RegisterVestingAccount** registers a vesting account

```javascript
{
"register_vesting_account": {
matthiasmatt marked this conversation as resolved.
Show resolved Hide resolved
"address": "cosmos1...",
"master_address": "cosmos1...",
"vesting_schedule": {
"linear_vesting": {
"start_time": "1703772805",
"end_time": "1703872805",
"vesting_amount": "1000000"
}
}
}
}
```

- **DeregisterVestingAccount** deregisters a vesting account

```javascript
{
"deregister_vesting_account": {
"address": "cosmos1...",
"denom": "uusd",
"vested_token_recipient": "cosmos1...", // address that will receive the vested tokens after deregistration. If None, tokens are received by the owner address.
"left_vested_token_recipient": "cosmos1...", // address that will receive the left vesting tokens after deregistration.
}
}
```

- **Claim** allows to claim vested tokens

```javascript
{
"claim": {
"denom": "uusd",
"recipient": "cosmos1...",
}
}
```

### 7.3 Query

- **VestingAccount** returns the vesting account details for a given address.

```javascript
{
"vesting_account": {
"address": "cosmos1...",
}
}
```
matthiasmatt marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Smart contract sandbox for Nibiru Chain.
└── 📂 core-shifter # Calls peg shift and depth shift in x/perp.
└── 📂 core-controller # Calls other admin calls from Nibiru foundation.
└── 📂 core-token-vesting # Token linear vesting contracts with optional cliffs.
└── 📂 airdrop-token-vesting # Token linear vesting contracts with optional cliffs but handled for airdrop.
├── 📂 nibiru-std # Nibiru Chain standard library for smart contracts
└── 📦 proto # Types and traits for QueryRequest::Stargate and CosmosMsg::Stargate
└── # Includes constructors for Cosmos, IBC, and Nibiru.
Expand Down
4 changes: 3 additions & 1 deletion contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@


- [**pricefeed**](./pricefeed): Legacy implementation of the Nibiru Oracle Module in pure
CosmWasm rather than the Cosmos-SDK.
CosmWasm rather than the Cosmos-SDK.

- [**airdrop-token-vesting**](./airdrop-token-vesting/README.md)
7 changes: 7 additions & 0 deletions contracts/airdrop-token-vesting/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --example schema"

12 changes: 12 additions & 0 deletions contracts/airdrop-token-vesting/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build results
/target

# Text file backups
**/*.rs.bk

# macOS
.DS_Store

# IDEs
*.iml
.idea
Loading
Loading