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

Conversation

matthiasmatt
Copy link
Contributor

@matthiasmatt matthiasmatt commented Feb 22, 2024

Summary by CodeRabbit

  • New Features
    • Introduced core token vesting functionality for CW20 and native tokens, including instantiation, execution, and query capabilities.
    • Added a new directory and contract for token linear vesting with optional cliffs.
  • Documentation
    • Updated README files to include details on airdrop token vesting and managing fungible tokens on the Nibiru Chain.
  • Refactor
    • Implemented aliases for building, testing, and schema generation in the airdrop token vesting project.
  • Chores
    • Updated .gitignore files to exclude unnecessary files.
    • Added checksum for the new airdrop_token_vesting.wasm artifact.
  • Tests
    • Included test functions for the airdrop token vesting contract, covering initialization, registration, and claiming scenarios.

This can be tested against a live chain with this script:

WALLET=devnet_wallet
MANAGER_WALLET=validator
REWARDEE_WALLET=rewardee

CONTRACT_PATH=airdrop_token_vesting.wasm

TX_FLAG=(--keyring-backend test --output json -y --gas 100000000)

ADMIN=nibi1ds5zr8pv3dqnj4glmr73yef5j4wxq4p3wfxuhv
MANAGER=nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl
REWARDEE=nibi1qad9nvdzha9ugl5y28fw3h3ujjg5mrpydrsmeh

# Send funds to managers
nibid tx bank send $WALLET $MANAGER 100000unibi -y $TX_FLAG

# Deploy the contract
nibid tx wasm store "$CONTRACT_PATH" --from $WALLET $TX_FLAG

# you have the code_id from the output of the store tx
CODE_ID=2

# Instantiate the contract
cat << EOF | jq '.' | tee instantiate.json
{
    "admin": "$ADMIN",
    "managers": ["$MANAGER"]
}
EOF
JSON_DATA="$(<instantiate.json)"

nibid tx wasm instantiate $CODE_ID "$JSON_DATA" \
    --amount 100unibi \
    --label "airdrop_vesting" --admin $ADMIN "${TX_FLAG[@]}" \
    --from $WALLET

# You can get the contract address from the output of the instantiate tx
CONTRACT_ADDRESS=nibi1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqugq26k

# reward a user
cat << EOF | jq '.' | tee reward.json
{
  "reward_users": {
    "master_address": "$ADMIN",
    "rewards": [
      {
        "user_address": "$REWARDEE",
        "vesting_amount": "50",
        "cliff_amount": "10"
      }
    ],
    "vesting_schedule": {
      "linear_vesting": {
        "start_time": "1708642800",
        "end_time": "1708729200",
        "vesting_amount": "0"
      }
    }
  }
}
EOF
JSON_DATA="$(<reward.json)"
nibid tx wasm execute $CONTRACT_ADDRESS "$JSON_DATA" --from $MANAGER_WALLET "${TX_FLAG[@]}"

# query the vesting account
nibid query wasm contract-state smart $CONTRACT_ADDRESS '{"vesting_accounts": {"address": "'$REWARDEE'"}}'


nibid query wasm contract-state smart $CONTRACT_ADDRESS '{"vesting_account": {"address": "'$REWARDEE'"}}' | jq .
{
  "data": {
    "address": "nibi1qad9nvdzha9ugl5y28fw3h3ujjg5mrpydrsmeh",
    "vestings": [
      {
        "master_address": "nibi1ds5zr8pv3dqnj4glmr73yef5j4wxq4p3wfxuhv",
        "vesting_denom": {
          "native": "unibi"
        },
        "vesting_amount": "50",
        "vested_amount": "0",
        "vesting_schedule": {
          "linear_vesting": {
            "start_time": "1708642800",
            "end_time": "1708729200",
            "vesting_amount": "50"
          }
        },
        "claimable_amount": "0"
      }
    ]
  }
}

# Withdraw the unallocated amount
cat << EOF | jq '.' | tee withdraw.json
{
  "withdraw": {
    "recipient": "$MANAGER",
    "amount": "50"
  }
}
EOF
JSON_DATA="$(<withdraw.json)"
nibid tx wasm execute $CONTRACT_ADDRESS "$JSON_DATA" --from $MANAGER_WALLET "${TX_FLAG[@]}"

Copy link
Contributor

coderabbitai bot commented Feb 22, 2024

Walkthrough

The project introduced a comprehensive update focused on token vesting functionalities, particularly enhancing the airdrop token vesting mechanism with optional cliffs for airdrop scenarios. It encompasses the addition of a new directory for airdrop token vesting, updates to documentation, error handling, message structuring, state management, and extensive testing for various contract interactions including instantiation, execution, and querying of vesting accounts.

Changes

File(s) Change Summary
Cookbook.md, README.md, contracts/README.md Added summaries and sections for airdrop token vesting.
contracts/airdrop-token-vesting/... Introduced a new directory with configurations, examples, contract logic, error handling, and more.
contracts/nibi-stargate/README.md, .gitignore, artifacts/checksums.txt Updated with new guides, ignored directories, and checksum entries.

Related issues

Poem

In the code where tokens dance,
A rabbit hopped, took a chance.
With vesting schemes, so bright and new,
Airdrops fall like morning dew.
🌟 Through the blockchain, far and wide,
With each commit, we stride with pride.
🚀 To the moon, our code shall leap,
In the ledger, forever to keep.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 97.46835% with 36 lines in your changes are missing coverage. Please review.

Project coverage is 87.55%. Comparing base (902b788) to head (5781f19).
Report is 6 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
contracts/airdrop-token-vesting/src/errors.rs 100.00% <100.00%> (ø)
contracts/airdrop-token-vesting/src/state.rs 100.00% <100.00%> (ø)
contracts/airdrop-token-vesting/src/contract.rs 98.09% <98.09%> (ø)
contracts/airdrop-token-vesting/src/testing.rs 98.26% <98.26%> (ø)
contracts/airdrop-token-vesting/src/msg.rs 92.47% <92.47%> (ø)

... and 7 files with indirect coverage changes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b8bb56a and fc5da15.
Files ignored due to path filters (8)
  • Cargo.lock is excluded by: !**/*.lock
  • contracts/airdrop-token-vesting/Cargo.lock is excluded by: !**/*.lock
  • contracts/airdrop-token-vesting/Cargo.toml is excluded by: !**/*.toml
  • contracts/airdrop-token-vesting/schema/cw20_hook_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/execute_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/instantiate_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/query_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/vesting_account_response.json is excluded by: !**/*.json
Files selected for processing (13)
  • Cookbook.md (1 hunks)
  • README.md (1 hunks)
  • contracts/README.md (1 hunks)
  • contracts/airdrop-token-vesting/.cargo/config (1 hunks)
  • contracts/airdrop-token-vesting/.gitignore (1 hunks)
  • contracts/airdrop-token-vesting/README.md (1 hunks)
  • contracts/airdrop-token-vesting/examples/schema.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/errors.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/lib.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/state.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/testing.rs (1 hunks)
Files skipped from review due to trivial changes (3)
  • contracts/airdrop-token-vesting/.cargo/config
  • contracts/airdrop-token-vesting/.gitignore
  • contracts/airdrop-token-vesting/examples/schema.rs
Additional comments: 27
contracts/airdrop-token-vesting/src/lib.rs (1)
  • 1-7: The module declarations and structure of lib.rs are clear and follow Rust's conventions for organizing code. Separating the contract logic, error handling, message definitions, and state management into their respective modules, along with a dedicated testing module, enhances maintainability and readability.
contracts/README.md (1)
  • 32-32: The addition of the "airdrop-token-vesting" section in the README.md file is a valuable update, ensuring that the documentation reflects the new features introduced in the project. It's crucial for users and developers to have easy access to information about all available contracts.
contracts/airdrop-token-vesting/src/errors.rs (1)
  • 1-51: The custom error types defined in errors.rs are well-structured and leverage the thiserror crate effectively, facilitating clear and manageable error handling within the airdrop token vesting contract. This approach enhances the contract's robustness and developer experience by providing specific, descriptive error messages.
README.md (1)
  • 17-17: The update to the root README.md to include the airdrop-token-vesting directory is a valuable addition, ensuring that the project documentation provides a comprehensive overview of its structure and features. Keeping the root README updated is essential for project navigation and understanding.
contracts/airdrop-token-vesting/src/state.rs (1)
  • 1-76: The state management defined in state.rs is well-structured, utilizing cw_storage_plus effectively for managing contract state. The Whitelist and VestingAccount structures are clearly defined, and the utility function denom_to_key provides a practical solution for handling different token denominations. This setup facilitates clear and efficient state management within the contract.
contracts/airdrop-token-vesting/README.md (1)
  • 1-70: The documentation provided in the README.md file within the airdrop-token-vesting directory is comprehensive and well-structured, covering key aspects of the contract's functionality, including master operations and vesting account operations. The inclusion of a section for deployed contract information, marked as TODO, is a good placeholder for future updates. This level of documentation is crucial for enabling developers and users to effectively understand and interact with the contract.
contracts/airdrop-token-vesting/src/msg.rs (1)
  • 1-301: The message structures and enums defined in msg.rs are clearly designed and cover a comprehensive range of interactions with the airdrop token vesting contract. The use of cw_serde for serialization and the detailed definitions of vesting schedules demonstrate a thoughtful approach to contract message design. This setup facilitates clear and flexible interactions with the contract, enhancing its usability and functionality.
contracts/airdrop-token-vesting/src/contract.rs (13)
  • 31-40: The validation for the deposit ensures only one type of token is deposited and that the amount is non-zero. This is a good practice for ensuring contract integrity and preventing misuse.
  • 118-121: The authorization check for reward_users function is essential for security. It ensures that only whitelisted members or the admin can execute this action. This is a good implementation of access control.
  • 132-137: Checking if the total requested amount exceeds the unallocated amount before proceeding with rewarding users is a good practice. It prevents the contract from committing to more rewards than it can handle, ensuring the integrity of the vesting process.
  • 209-211: Checking for the existence of a vesting account before creating a new one is a good practice to avoid overwriting existing data. This ensures data integrity and prevents accidental loss of vesting information.
  • 265-268: The authorization check in deregister_vesting_account ensures that only the master address associated with the vesting account can deregister it. This is a critical security measure to prevent unauthorized access and manipulation of vesting accounts.
  • 281-305: The logic for transferring the claimable and left vesting amounts during account deregistration is well-implemented. It ensures that vested tokens are correctly distributed according to the vesting schedule and remaining tokens are returned. This maintains the integrity of the token distribution process.
  • 350-352: The check for zero claimable amount in the claim function is a good optimization. It prevents unnecessary operations and network fees for transactions that would have no effect.
  • 355-363: Removing the vesting account from storage if the claimed amount equals the vesting amount is a good practice for cleaning up state and optimizing contract storage usage. This helps in managing the contract's state efficiently.
  • 391-403: The build_send_msg function encapsulates the creation of a BankMsg::Send message, making the code more modular and readable. This is a good example of encapsulating functionality for reuse and clarity.
  • 426-471: The vesting_account query function implementation, including pagination and filtering by min_denom, is well-designed. It provides a flexible and efficient way to retrieve vesting account information, adhering to best practices for smart contract queries.
  • 513-539: The test case deregister_err_nonexistent_vesting_account correctly checks for the error scenario where a non-existent vesting account is attempted to be deregistered. This is a good practice for ensuring the contract behaves as expected in error conditions.
  • 542-588: The test case deregister_err_unauthorized_vesting_account verifies that only the master address can deregister a vesting account, which is crucial for contract security. This test ensures that the contract's access control mechanisms are functioning as intended.
  • 591-632: The test case deregister_successful demonstrates the successful deregistration of a vesting account by the master address. It's important to have positive test cases like this to confirm that the contract's intended functionality works as expected.
contracts/airdrop-token-vesting/src/testing.rs (7)
  • 19-31: The test proper_initialization correctly sets up a mock environment and dependencies, and asserts that the contract can be instantiated with valid parameters. This test ensures that the contract's initialization logic is functioning as expected.
  • 34-81: The test invalid_coin_sent_instantiation effectively checks for errors when instantiating the contract with invalid coin amounts (no coins or multiple coin types). It's good practice to validate input constraints, ensuring robust error handling in the contract.
  • 84-160: The test invalid_manangers_initialization covers various scenarios of invalid manager configurations during contract instantiation, such as empty managers list, too short manager addresses, and an empty admin address. These tests are crucial for verifying input validation and error handling related to manager configurations.
  • 212-337: The test register_cliff_vesting_account_with_native_token thoroughly checks various error scenarios related to registering vesting accounts with cliffs, including zero vesting amount, invalid cliff times, and insufficient funds. These tests are essential for ensuring the contract's robustness in handling edge cases and error conditions during vesting account registration.
  • 340-354: The utility function require_error is a helpful abstraction for asserting expected errors in test scenarios. It simplifies the test code and enhances readability by encapsulating the pattern of executing a contract function and matching the result against an expected error.
  • 356-521: The test register_vesting_account_with_native_token covers scenarios for registering vesting accounts without cliffs, including zero vesting amount, excessive vesting amounts, and a successful registration with valid parameters. It also includes a query to verify the vesting account's state post-registration. This test is comprehensive and ensures that vesting account registration and state querying work as intended.
  • 524-680: The test claim_native validates the claiming process for vested tokens, including error handling for non-existent vesting entries and successful claims with correct amounts. It also verifies the state of the vesting account post-claim. This test is crucial for ensuring the correctness of the claiming logic and the contract's ability to update vesting account states accurately.

Cookbook.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fc5da15 and a69712e.
Files selected for processing (1)
  • Cookbook.md (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Cookbook.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a69712e and 182cea9.
Files ignored due to path filters (5)
  • Cargo.lock is excluded by: !**/*.lock
  • contracts/airdrop-token-vesting/schema/execute_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/instantiate_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/query_msg.json is excluded by: !**/*.json
  • contracts/airdrop/Cargo.toml is excluded by: !**/*.toml
Files selected for processing (4)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/state.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/testing.rs (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • contracts/airdrop-token-vesting/src/contract.rs
  • contracts/airdrop-token-vesting/src/msg.rs
  • contracts/airdrop-token-vesting/src/state.rs
  • contracts/airdrop-token-vesting/src/testing.rs

Cookbook.md Outdated Show resolved Hide resolved
Cookbook.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 182cea9 and 5a41b55.
Files ignored due to path filters (1)
  • artifacts/airdrop_token_vesting.wasm is excluded by: !**/*.wasm
Files selected for processing (1)
  • Cookbook.md (6 hunks)

Comment on lines +263 to +264
{
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instantiation message for the core token vesting contract is mentioned as not existing, which might be intentional to indicate that no specific parameters are required for instantiation. However, it's crucial to ensure that this is clearly communicated to avoid confusion. If instantiation does not require parameters, consider adding a brief explanation to clarify this to users.

{
+  "Note": "This contract does not require any parameters for instantiation."
}

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
{
}
{
"Note": "This contract does not require any parameters for instantiation."
}

Cookbook.md Show resolved Hide resolved
Cookbook.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5a41b55 and 90987c1.
Files selected for processing (2)
  • Cookbook.md (6 hunks)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • Cookbook.md
  • contracts/airdrop-token-vesting/src/contract.rs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 90987c1 and 248b47f.
Files selected for processing (3)
  • .gitignore (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
  • contracts/nibi-stargate/README.md (2 hunks)
Files skipped from review due to trivial changes (1)
  • contracts/nibi-stargate/README.md
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/src/msg.rs
Additional comments: 1
.gitignore (1)
  • 23-23: The addition of .idea/ to the .gitignore file is a good practice to prevent IDE-specific settings from cluttering the repository. This ensures that project settings specific to JetBrains IDEs, which might be used by some developers working on this Rust project, are not accidentally committed. Keeping such settings out of version control helps maintain a clean and conflict-free repository, which is beneficial for collaboration across different development environments.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 248b47f and c3371ae.
Files selected for processing (2)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • contracts/airdrop-token-vesting/src/contract.rs
  • contracts/airdrop-token-vesting/src/msg.rs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c3371ae and 63b13a1.
Files selected for processing (1)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/src/contract.rs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 63b13a1 and 502efdb.
Files selected for processing (1)
  • contracts/airdrop-token-vesting/README.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/README.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 502efdb and e0474f2.
Files ignored due to path filters (4)
  • artifacts/airdrop_token_vesting.wasm is excluded by: !**/*.wasm
  • contracts/airdrop-token-vesting/schema/execute_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/query_msg.json is excluded by: !**/*.json
  • contracts/airdrop-token-vesting/schema/vesting_account_response.json is excluded by: !**/*.json
Files selected for processing (6)
  • Cookbook.md (6 hunks)
  • artifacts/checksums.txt (1 hunks)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/state.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/testing.rs (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • Cookbook.md
  • contracts/airdrop-token-vesting/src/contract.rs
  • contracts/airdrop-token-vesting/src/msg.rs
  • contracts/airdrop-token-vesting/src/state.rs
  • contracts/airdrop-token-vesting/src/testing.rs
Additional comments: 1
artifacts/checksums.txt (1)
  • 2-2: The addition of the checksum for airdrop_token_vesting.wasm aligns with the PR's objective of introducing a new airdrop vesting contract. Ensure the checksum is verified against the actual .wasm file to confirm its integrity.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e0474f2 and c1846cc.
Files selected for processing (1)
  • contracts/airdrop-token-vesting/README.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/README.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c1846cc and a770c8f.
Files selected for processing (1)
  • contracts/airdrop-token-vesting/README.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/README.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a770c8f and b5fb8a6.
Files selected for processing (1)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/src/contract.rs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b5fb8a6 and f79a77a.
Files ignored due to path filters (1)
  • Cargo.lock is excluded by: !**/*.lock
Files selected for processing (1)
  • contracts/airdrop-token-vesting/README.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • contracts/airdrop-token-vesting/README.md

Copy link
Member

@k-yang k-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also revert the query interface back to the same as core-token-vesting, so that the frontend can keep using the same query patterns?

StdError::generic_err("Insufficient funds for all rewards").into()
);
}
vesting_schedule.validate_time(env.block.time)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this time validation necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends. It is a little arbitrary because there is no consistency. Do we want to allow deploying without taking care of if the cliff or the start time is in the past?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f79a77a and 5781f19.
Files ignored due to path filters (3)
  • Cargo.lock is excluded by: !**/*.lock
  • artifacts/airdrop_token_vesting.wasm is excluded by: !**/*.wasm
  • contracts/airdrop-token-vesting/schema/query_msg.json is excluded by: !**/*.json
Files selected for processing (4)
  • artifacts/checksums.txt (1 hunks)
  • contracts/airdrop-token-vesting/src/contract.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/msg.rs (1 hunks)
  • contracts/airdrop-token-vesting/src/testing.rs (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • artifacts/checksums.txt
  • contracts/airdrop-token-vesting/src/contract.rs
  • contracts/airdrop-token-vesting/src/msg.rs
  • contracts/airdrop-token-vesting/src/testing.rs

@matthiasmatt matthiasmatt merged commit 5436b53 into main Feb 27, 2024
5 checks passed
@matthiasmatt matthiasmatt deleted the mat/airdrop-vesting branch February 27, 2024 18:59
@Unique-Divine Unique-Divine changed the title feat: create airdrop vesting contract feat(contracts): create airdrop vesting contract with manager list Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(token-vesting): add manager list to core-token-vesting contract
4 participants