Coder Social home page Coder Social logo

v1-contracts's People

Contributors

0xfable avatar abstruse-goose avatar alienhunteronmars avatar cyberhoward avatar javierjmc avatar jvr0x avatar kaimen-sano avatar kerber0x avatar lubkoll avatar ohmroger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

v1-contracts's Issues

[Clean-up] white_whale_testing

The white_whale_testing package used in the stabecoin vault and profit-check contract causes compile errors if included in build. If not included, the tests that rely on the package don't compile. We should fix this before sending to audit.

Contract end to end test

We got some great coverage thanks to the addition of cw-multi-test. Explore and attempt to add some python-based end-to-end tests.

[stablecoin-vault] User cannot withdraw all of their deposit

When a user has deposited money into the vault
Then attempts to withdraw all their funds we see this issue :

error: "rpc error: code = InvalidArgument desc = failed to execute message; message index: 0: dispatch: dispatch: Error calling the VM: Error executing Wasm: Wasmer runtime error: RuntimeError: unreachable: execute wasm contract failed: invalid reques 

The understanding so far is this can happen when attempting to withdraw all funds from a vault as currently the fees for withdrawing funds from anchor are not taken into account.

[stablecoin-vault] Error on deposit msg by trader

When the trader account sends an Anchor deposit msg to the vault, it throws an Unauthorized error:

failed to execute message; message index: 0: Caller is not admin: execute wasm contract failed: invalid request

[Governance] Execute poll set_slippage msg fails

When calling execute_poll(), on a poll that was passed, with a payload to change the slippage of the stablecoin vault. An error gets thrown:

height=5930557, txhash='FCAD9A2BCDA3BBBC02638BC6B7113D7573B90761372AE3E559499DDF0B6A359D', raw_log='failed to execute message; message index: 0: dispatch: Caller is not admin: execute wasm contract failed'

The set_slippage function of the stable-coin vault contract expects the caller to be the owner of the contract (which is not the case).

[Treasury] Test send token

The send test of the treasury contract is broken and needs to be fixed. Should we consider removing this function from the contract?

[stablecoin-vault] Runtime error on adding liquidity

When calling the provide_liquidity function with an account different from the admin account, a runtime error is thrown.

This can be seen in the terra explorer (https://finder.terra.money/bombay-12/address/terra129tj5d05a33syucpd32v6anncy9lu680cwcg44)

Interestingly, when trying to provide liquidity with the admin account, no error is thrown.
Also note that the admin account was the first account to add liquidity to the vault.

Error log:

'failed to execute message; message index: 0: dispatch: Error calling the VM: Error executing Wasm: Wasmer runtime error: RuntimeError: unreachable: execute wasm contract failed', gas_wanted=6900000, gas_used=59098, logs=None, code=4, codespace='wasm')

[Bug] Broken integration test

The integration tests for stablecoin-vault have broken, this indicates something changed that needs to be accounted for. When I run the tests I see this error :

Denominator must not be zero 

for both
tests::integration_test::stablecoin_vault_fees_are_allocated

and

tests::integration_test::for_big_sums_anchor_deposit_or_withdraw_is_called_and_fees_are_allocated

Possibly something minor changed in ProvideLiquidity and the tests need to account for that.

Cargo deps

Some of the deps need to be looked at and reorganised. Some deps make sense in dependancies but some need to be in dev-dependancies for compilation reasons.

[Terraswap dApp] Add tests to terraswap contract

The terraswap contract is missing some important unit-tests. These tests should only probe the application specific logic.
Logic that depends on the base dapp package should be testing in its respective directory.

[dApps] Integration testing

The integration testing infrastructure for the dapps will test all the inter-contract interactions. It would be beneficial to create a text document in each dapp that specifies what tests are handled where (unit testing vs integration), along with an estimate of the over-all test coverage.

[Contracts CICD] Add cargo tarpulin to CI/CD jobs for all contracts

Having researched the process some firms use for their audits it looks like it would be valueable to add the tarpulin coverage tool to all our contract runs. This is one thing that is done by some audit firms it seems as a standard procedure.
Will give good insight on coverage also.

Capital Flows for Contracts

Given a number of arb vaults
AND the other prerequisite white whale contracts such as buy/burn vaults, governance and so on
When the contracts are deployed
Then capital deposited and used in each contract generates fees and profits
And Then these fees and profits are allocated as expected through the White Whale ecosystem.

Create a War Chest Contract

Given a series of arbitrage vaults
When the vaults are interacted with
Then a protocol fee is taken by White Whale
And Then this fee is in part sent to the war chest

Given a war-chest contract which contains funds
When a governance proposal to spend the war chest is passed
Then the war-chest contract can deploy accumulate funds
to a destination of choice

Columbus 5 Testnet Verification

As a white whale team member
I want to see and know that the WW contracts have been deployed tested and verified on the Columbus 5 mainnet
So that we feel ready to go to audit.

This is a rather big issue and so far alot of work has been done on the bombay 10 network

Contract migrations

We need to get a better understanding of contract migrations, what we need to add to our code and if we can test it in some means. We can keep proceeding without it but it would mean when live we can better handle changes.

[Governance] Small difference between staked and reported staked amount

When staking my Guppy tokens on the governance contract and querying for my staked balance. The amount I staked and the reported staked amount are off by 1 µGGY. For example:

  • I stake 5_000_000 µGGY to the contract
  • I do a Staker query with my address specified
  • The query returns a value of 4_999_999

Might not be an issue.

Update tests commented out during migration

We have some tests with are prevented from running with

    // #[test]

some of these are also marked with

    // TODO: Test candidate to fix

These tests either need to be updated to work and uncommented or removed if they are now redundant.

Governance; migrate staking to new staking module

We are moving to a new staking model to better suit our arch which includes a treasury, staking needs to be migrated from the gov contract to a common staking contract and then gov may need to query this contract to understand the weight of a given user.

Create PR Checklist/Template for better reviews.

Simple issue but takes some time.
We need to get a small understanding on what should and shouldn't be included in contracts. This could be done all the way to make an actual template for the PR
Instead. This issue could just maintain a list of things.

Examples:

  • Cosmwasm contracts are at times generated from templates, define any files to ensure aren't included
  • tbd

[Governance] poll passes without staking snapshot

Governance votes pass even though no snapshot_poll() was called on it.

  • Status: passed
  • Staked_amount: None

Poll query response:

{'id': 1, 'creator': 'terra1gxsfv4ruvda37q3ta0kwx42w7qy5l9hf9l30sz', 'status': 'passed', 'end_height': 5916289, 'title': 'Set Slippage to 0.008', 'description': 'set slippage to 0.008', 'link': 'https://whitewhale.finance', 'deposit_amount': '100000', 'execute_data': [{'order': 1, 'contract': 'terra14uqjlrg5efah459xkstxavf3wr7ku8s0j5h328', 'msg': 'eyJzZXRfc2xpcHBhZ2UiOiB7InNsaXBwYWdlIjogIjAuMDA4In19'}], 'yes_votes': '50000000', 'no_votes': '0', 'staked_amount': None, 'total_balance_at_end_poll': '50000000'}

Proposed solution: Take staking snapshot when the poll is created.

Create a LP Staking Incentive Contract

As a liquidity provider
I want a tempting APR/APY on WHALE LP
so that I more reason to consider providing LP there versus another pool.

Given the Whale token is available on terraswap
When network users start to perform liquidity provision with WHALE and UST
Then they can choose their LP tokens in the Staking Incentive Contract
And Then they will receive a 'boosted' APR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.