Coder Social home page Coder Social logo

white-whale-defi-platform / white-whale-core Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 21.0 7.71 MB

Core contracts for White Whale, The Interchain Liquidity Protocol for the Cosmos.

Home Page: https://whitewhale.money

License: MIT License

Shell 5.46% Rust 94.18% Python 0.23% Just 0.13%
arbitrage cosmwasm flashloan ibc smart-contracts arbitrage-bot blockchain

white-whale-core's People

Contributors

0xfable avatar art3mix avatar aweigold avatar csanti avatar eliseoci avatar ezaanm avatar janfabian avatar joowonyun avatar kaimen-sano avatar kerber0x avatar nova-veritas avatar nseguias avatar ouiliame avatar pronvis avatar sen-com avatar xlk3099 avatar yun-yeo 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

white-whale-core's Issues

Bump rust version to 1.64.0

If you want to report a security issue, please follow our security policy: https://github.com/White-Whale-Defi-Platform/migaloo-core/blob/main/SECURITY.md


Improvement description

Rust 1.64.0 has some juicy features we can use, for instance to handle dependencies from the workspace.

Read more at https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html


Additional context

Add any other context here, code snippets, json responses, screenshots and so on.

Code sample
Logs
Screenshots

https://www.youtube.com/watch?v=CO5Xo76CVCk

Improve deployment script

[x] Make it recover from errors
[x] Make it possible to deploy specific contract
[x] Make it possible to create pools and vaults
[ ] Possible rewrite in another language? go, python

Check artifacts size

Use case

Create script to check artifacts size to make sure they can be uploaded to the blockchain, potentially integrate it with the github actions.

Proposal

Create ExecuteMsg for removing a pool from the pool factory

Use case

Pools are added to the pool directory once they are created by the factory, but there is no way to delete them. Contracts will live forever on the blockchain, but if for some reason a pool is broken in any way, for example if they are instantiated wrong (wrong assets) it could be handy to be able to remove it from the directory to keep things clean.

Proposal

Create and implement ExecuteMsg::RemovePair { pair_address: String } on the terraswap_factory contract.

Fix Codecov CI not uploading report

Seems like tarpaulin action is broken or something, the action specifies to output an html file and yet the logs say a json file is generated.

Then the codecov action can't find the file in the right path.

Improve CI/CD runs time with caching additions

Improvement description

Improve CI/CD runs time with caching additions to avoid redownloading deps all the time

Additional context

Right now we have some working CI/CD system which performs all sorts of checks against out contracts such as tests, coverage, schema updates as well as some linting variants. The bulk of the run time right now is in installing the dependancies for these builds, namely dylint as well as others. We should be able to, with a known steady version of Rust and dylint leverage the cache system to really bring these build times down.

rust 1.63.0 clippy::derive_partial_eq_without_eq

For the version 1.63. clippy::derive_partial_eq_without_eq https://rust-lang.github.io/rust-clippy/rust-1.63.0/index.html#derive_partial_eq_without_eq is not passing the clippy command

cargo clippy -- -D warnings

error: you are deriving `PartialEq` and can implement `Eq`
 --> packages/white-whale/src/fee.rs:6:48
  |
6 | #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, JsonSchema)]
  |                                                ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
  |
  = note: `-D clippy::derive-partial-eq-without-eq` implied by `-D warnings`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

error: could not compile `white-whale` due to previous error

Remove the regex crate

Implement the ibc token matcher manually to decrease the wasm file size, the regex crate even with selected features was doubling the optimized wasm file size.

Collect fees for vault factory not working

The following query is not working:

{
  "collect_fees":{
    "collect_fees_for":{
      "factory":{
        "factory_addr":"address",
        "factory_type":{
          "vault":{}
        }
      }
    }
  }
}

Error: Query failed with (18): failed to execute message; message index: 0: Generic error: Querier contract error: codespace: wasm, code: 9: execute wasm contract failed: invalid request

P.S.: You can still collect the fees for a vault by using CollectFeesFor::Contracts and providing the vault.

Go through bestpractices.coreinfrastructure.org and finish the points that need coverage

There are few items that need to be revised:

[ ] Documentation
[ ] include interim versions and not only releases
[ ] The release notes MUST identify every publicly known run-time vulnerability fixed in this release that already had a CVE assignment or similar when the release was created
[ ] Test policy
[ ] be maximally strict with warnings in the software produced by the project, where practical.
[ ] Use basic good cryptographic practices
[ ] Static/Dynamic code analysis

Add third fee option for pools, the burn fee

If you want to report a security issue, please follow our security policy: https://github.com/White-Whale-Defi-Platform/migaloo-core/blob/main/SECURITY.md


Improvement description

Described during a meeting regarding deployment to certain networks
Currently we have two fees implemented, a Protocol Fee and a Swap Fee. This proposal describes adding a third fee structure to the current fee system called a Burn Fee. This Fee is optional per deployment meaning unless specified there is no Burn Fee for a network, only the original two fees. When specified, this Burn Fee will deduct N bps share as a fee similarly to the 2 earlier mentioned Fees but instead of being collected will be burned that is to say specific calling the Burn function on a given token or sending to a designated burn address.


Additional context

Add any other context here, code snippets, json responses, screenshots and so on.

Code sample
Logs
Screenshots

Can't create vaults for IBC tokens due the wrong ticker symbol

The vault uses the following ticker symbol:

    let lp_symbol = format!(
        "uLP-{}",
        msg.asset_info
            .clone()
            .get_label(&deps.as_ref())?
            .chars()
            .take(8)
            .collect::<String>()
    );

which in case of an IBC token would like like uLP-ibc/1234...5678, which contains invalid characters for a token symbol. The easiest fix would be to make the token symbol generic as we did for the pools, while keeping the contract label custom.

Error when trying to create a vault with an IBC token:
Ticker symbol is not in expected format [a-zA-Z\-]{3,12}: instantiate wasm contract failed: invalid request.

build_schemas script buggy for fee_collector contract

The build_schemas.sh script generates additional schemas in folders where they are not needed on the fee_collector contract.


Steps to Reproduce

  1. Execute scripts/build_schemas.sh

Expected results:
schema files being generated under /contract_name/schema/

Actual results:
schema files generated under
/contract_name/schema/schema
/contract_name/examples/schema
/contract_name/src/schema


Additional context

Add any other context about the problem here, code snippets, json responses and so on.

Code sample
Logs

Add queries to Fee Collector

There are two important queries missing on the fee collector, namely "collected fees" i.e. fees sitting on the fee collector, those that have been collected already. Then another query to see the fees that have been accrued (but not collected) by the vaults/pools. The latter will probably need pagination.

Analyze the cosmwasm-std iterator feature usage

Go through migaloo contracts and study if the iterator feature is needed for all the contracts.

At the moment, it is being imported everywhere as it is being inherited from the workspace. Removing it from where it isn't needed would decrease the wasm size.

Create ExecuteMsg for removing a vault from the vault factory

Use case

Vaults are added to the vault directory once they are created by the factory, but there is no way to delete them. Contracts will live forever on the blockchain, but if for some reason a vault is broken in any way, for example if they are instantiated wrong (wrong assets) it could be handy to be able to remove it from the directory to keep things clean.

Proposal

Create and implement ExecuteMsg::RemoveVault { vault_address: String } on the vault_factory contract.

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.