-
Notifications
You must be signed in to change notification settings - Fork 0
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
DCA bot pancakeswap audit #1
base: empty
Are you sure you want to change the base?
Conversation
filters: | ||
branches: | ||
only: | ||
- master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this repo only has a main
branch.
[package] | ||
name = "dca-bot-pancakeswap-cw" | ||
version = "0.1.0" | ||
authors = ["wc117"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a Halo reference?
|
||
There is a view function in the smart contract that returns swappable id, minimal out amount, and remaining trade counts that can be swapped on Uniswap V2 or a DEX that works just like it. | ||
|
||
A scheduler or script fetch the swappable id from the Vyper smart contract and run `swap` function with the id and minimal out amount. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/fetch/fetches, s/run/runs
Not sure what "minimal out amount" means in context.
|
||
Users can deposit their token or coin into a Vyper smart contract on EVM chain. | ||
|
||
There is a view function in the smart contract that returns swappable id, minimal out amount, and remaining trade counts that can be swapped on Uniswap V2 or a DEX that works just like it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is a function named view
use backticks, otherwise name it here (and name these other things e.g.
returns swappable id (
swap_id
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like the entire artifacts/
directory should not be here, and should be in .gitignore
.
amount_out_min: Uint256, | ||
number_trades: Uint256, | ||
) -> Result<Response<PalomaMsg>, ContractError> { | ||
let state = STATE.load(deps.storage)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be loaded way down where it's used.
// Add any other custom errors you like here. | ||
// Look at https://docs.rs/thiserror/1.0.21/thiserror/ for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete some of the boilerplate probably.
number_trades.to_be_bytes().as_slice(), | ||
), | ||
)? { | ||
if timestamp.plus_seconds(retry_delay).lt(&env.block.time) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that this is a separate if
seems like a bug.
No description provided.