-
Notifications
You must be signed in to change notification settings - Fork 43
[FEAT] Bumps to web3 v6, adds linters, adds tests (pending upstream merge) #55
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
Open
8ball030
wants to merge
100
commits into
balancer:main
Choose a base branch
from
8ball030:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
d3ccf9f
bumped to web6
8ball030 3ef2a33
[feat] deps
4218170
bumped to web3v6
8ball030 0656963
small improvements
8ball030 f858316
reverted testing changes
8ball030 0bcefb4
added test for graph
8ball030 1cc7137
[chore] ensured pep8 compliance
8ball030 5498b3e
[chore] ensured pep8 compliance
8ball030 e55ab2f
[chore] ensured pep8 compliance
8ball030 61c6efd
[chore] added dev deps group
8ball030 98bf435
[chore] added docs
8ball030 521fb53
added test for graph
8ball030 ebb6ac9
[feat] ensured commit matches
8ball030 baedb62
Merge pull request #1 from 8ball030/feat/syncing-changes-2
8ball030 8c1b44f
feat: added base
8ball030 dc7d0d7
feat: added base
8ball030 f845b54
feat: add apiEndpoint to balpy class
8ball030 ba00442
feat: relaxed dependencies
8ball030 c64e790
Merge pull request #3 from 8ball030/feat/improvments
8ball030 b83aa67
Merge pull request #4 from 8ball030/feat/stable
8ball030 c715f93
feat: relaxed dependencies
8ball030 c73beed
feat: updated for v3 api
4f57f1e
chore: relaxed deps
8af73de
Merge branch 'main' into feat/updated-upstream
8ball030 f3ad8d2
chore: regenerated poetry lock
0b5e9a1
Merge pull request #5 from 8ball030/feat/updated-upstream
8ball030 d00c791
feat:fixed import
5462bd7
chore: linters and api3 integration
ef17927
fix: retry to account for blocking
419b598
Merge branch 'main' into feat/updates
8ball030 a804c81
Merge pull request #6 from 8ball030/feat/updates
8ball030 86ef737
chore: removed unused code
4269105
chore: improve-balpy api response handling to advoid rpc
9dff00a
chore: improve copy of query
ea5392d
chore:workflows-and-github
d2cd8b0
Merge pull request #7 from 8ball030/feat/preparing-fork
8ball030 136d305
feat/ensured-passes-ci
55052fd
feat:tbump
b70a2be
Bump to 0.0.2
54743a2
Bump to 0.0.3
87f4759
feat:bumping
5e27278
Bump to 0.0.4
f0f4998
feat:bumping
294c3a8
Bump to 0.0.5
e75a06d
feat:added-common-checks
b1b3961
Bump to 0.0.6
2f0add9
feat:aligning-relase-versions
cfb4364
Bump to 0.0.7
db3bc9d
feat:refactor
0ee7aee
Merge pull request #8 from 8ball030/feat/extra-endpoints
8ball030 061fa7f
Bump to 0.0.8
4f9391b
Bump to 0.0.9
aaab40e
feat:Add MODE support in balpy
gauravlochab 5c4b104
chore:version update to 0.1.0 for release
gauravlochab f2083dd
feat: Add mode.json for various tasks
gauravlochab e34ffb4
fix: resolve ci issue for lockfile
gauravlochab 0cf7daa
Merge pull request #9 from 8ball030/feat/add-mode
8ball030 8562d02
fix:added-deployments-docs-table
335a7bf
Bump to 0.1.1
073d739
Bump to 0.1.1
9ba7dc3
feat: return batch swap call data
xiuxiuxar fcbfb5e
set SOR to find v2 swaps only and return only bytes32 poolids
xiuxiuxar 6bda2e7
revert to correct poolid logic, now that API returns v2 only
xiuxiuxar 6163eca
define sender and recipient for safe address compatibility
xiuxiuxar 476e400
remove unneeded code
xiuxiuxar 75c03aa
fix ci, bump versions
xiuxiuxar 5b3226d
bump ci poetry
xiuxiuxar 4f0911f
update lockfile
xiuxiuxar 1771c21
bump ci poetry
xiuxiuxar 377be32
feat:fixed-ci-issues
f0e3a4a
feat:fixed-ci-issues
f428ae1
feat:fixed-ci-issues
7635168
fix:lock-issues
3236b71
Merge branch 'main' into test-fixes
8ball030 e18f75d
fix:lock-issues
563b5ac
fix:linter-issues
aa22a72
Merge pull request #13 from 8ball030/test-fixes
8ball030 1585a71
Merge pull request #10 from 8ball030/feat/generate-deployments-docs-t…
8ball030 3c98d31
Merge branch 'fix/swaps' into chore/fix-swap-data
8ball030 86e1dbd
Merge pull request #12 from xiuxiuxar/chore/fix-swap-data
8ball030 ceeceaa
fix:relock-poetry
9f3ff95
chore:linters
44ebe20
Merge pull request #14 from 8ball030/fix/swaps
8ball030 7b3770a
feat: add get ticker graph query
xiuxiuxar c2d9936
Merge pull request #15 from xiuxiuxar/feat/add-ticker-query
8ball030 62bce53
Bump to 0.1.2
a716de5
feat:example-and-improvements
6ff2553
chore:linters
bae2c69
Bump to 0.1.3
969baff
feat:fixed-query-to-pin-protocol
371855b
Bump to 0.1.4
ae7f670
bump multicaller -> v0.3.0
xiuxiuxar dfd92a8
Merge branch 'main' into chore/bump-multicaller
xiuxiuxar b72f9c2
Merge pull request #17 from xiuxiuxar/chore/bump-multicaller
8ball030 d2bdf77
Merge pull request #18 from 8ball030/bump-multicaller
8ball030 4d310da
Bump to 0.1.5
85d53bc
remove web3 middleware
xiuxiuxar 1e99104
Merge pull request #19 from xiuxiuxar/chore/remove-web3-middleware
8ball030 a65aace
Bump to 0.1.6
4f52515
feat:fixing-deps
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +0,0 @@ | ||
| from .balancerErrors import handleException | ||
| from balpy import balpy | ||
|
|
||
Submodule balancer-deployments
updated
266 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,107 +1,110 @@ | ||
| codes = {0:"ADD_OVERFLOW", | ||
| 1:"SUB_OVERFLOW", | ||
| 2:"SUB_UNDERFLOW", | ||
| 3:"MUL_OVERFLOW", | ||
| 4:"ZERO_DIVISION", | ||
| 5:"DIV_INTERNAL", | ||
| 6:"X_OUT_OF_BOUNDS", | ||
| 7:"Y_OUT_OF_BOUNDS", | ||
| 8:"PRODUCT_OUT_OF_BOUNDS", | ||
| 9:"INVALID_EXPONENT", | ||
| 100:"OUT_OF_BOUNDS", | ||
| 101:"UNSORTED_ARRAY", | ||
| 102:"UNSORTED_TOKENS", | ||
| 103:"INPUT_LENGTH_MISMATCH", | ||
| 104:"ZERO_TOKEN", | ||
| 200:"MIN_TOKENS", | ||
| 201:"MAX_TOKENS", | ||
| 202:"MAX_SWAP_FEE_PERCENTAGE", | ||
| 203:"MIN_SWAP_FEE_PERCENTAGE", | ||
| 204:"MINIMUM_BPT", | ||
| 205:"CALLER_NOT_VAULT", | ||
| 206:"UNINITIALIZED", | ||
| 207:"BPT_IN_MAX_AMOUNT", | ||
| 208:"BPT_OUT_MIN_AMOUNT", | ||
| 209:"EXPIRED_PERMIT", | ||
| 300:"MIN_AMP", | ||
| 301:"MAX_AMP", | ||
| 302:"MIN_WEIGHT", | ||
| 303:"MAX_STABLE_TOKENS", | ||
| 304:"MAX_IN_RATIO", | ||
| 305:"MAX_OUT_RATIO", | ||
| 306:"MIN_BPT_IN_FOR_TOKEN_OUT", | ||
| 307:"MAX_OUT_BPT_FOR_TOKEN_IN", | ||
| 308:"NORMALIZED_WEIGHT_INVARIANT", | ||
| 309:"INVALID_TOKEN", | ||
| 310:"UNHANDLED_JOIN_KIND", | ||
| 311:"ZERO_INVARIANT", | ||
| 400:"REENTRANCY", | ||
| 401:"SENDER_NOT_ALLOWED", | ||
| 402:"PAUSED", | ||
| 403:"PAUSE_WINDOW_EXPIRED", | ||
| 404:"MAX_PAUSE_WINDOW_DURATION", | ||
| 405:"MAX_BUFFER_PERIOD_DURATION", | ||
| 406:"INSUFFICIENT_BALANCE", | ||
| 407:"INSUFFICIENT_ALLOWANCE", | ||
| 408:"ERC20_TRANSFER_FROM_ZERO_ADDRESS", | ||
| 409:"ERC20_TRANSFER_TO_ZERO_ADDRESS", | ||
| 410:"ERC20_MINT_TO_ZERO_ADDRESS", | ||
| 411:"ERC20_BURN_FROM_ZERO_ADDRESS", | ||
| 412:"ERC20_APPROVE_FROM_ZERO_ADDRESS", | ||
| 413:"ERC20_APPROVE_TO_ZERO_ADDRESS", | ||
| 414:"ERC20_TRANSFER_EXCEEDS_ALLOWANCE", | ||
| 415:"ERC20_DECREASED_ALLOWANCE_BELOW_ZERO", | ||
| 416:"ERC20_TRANSFER_EXCEEDS_BALANCE", | ||
| 417:"ERC20_BURN_EXCEEDS_ALLOWANCE", | ||
| 418:"SAFE_ERC20_CALL_FAILED", | ||
| 419:"ADDRESS_INSUFFICIENT_BALANCE", | ||
| 420:"ADDRESS_CANNOT_SEND_VALUE", | ||
| 421:"SAFE_CAST_VALUE_CANT_FIT_INT256", | ||
| 422:"GRANT_SENDER_NOT_ADMIN", | ||
| 423:"REVOKE_SENDER_NOT_ADMIN", | ||
| 424:"RENOUNCE_SENDER_NOT_ALLOWED", | ||
| 425:"BUFFER_PERIOD_EXPIRED", | ||
| 500:"INVALID_POOL_ID", | ||
| 501:"CALLER_NOT_POOL", | ||
| 502:"SENDER_NOT_ASSET_MANAGER", | ||
| 503:"USER_DOESNT_ALLOW_RELAYER", | ||
| 504:"INVALID_SIGNATURE", | ||
| 505:"EXIT_BELOW_MIN", | ||
| 506:"JOIN_ABOVE_MAX", | ||
| 507:"SWAP_LIMIT", | ||
| 508:"SWAP_DEADLINE", | ||
| 509:"CANNOT_SWAP_SAME_TOKEN", | ||
| 510:"UNKNOWN_AMOUNT_IN_FIRST_SWAP", | ||
| 511:"MALCONSTRUCTED_MULTIHOP_SWAP", | ||
| 512:"INTERNAL_BALANCE_OVERFLOW", | ||
| 513:"INSUFFICIENT_INTERNAL_BALANCE", | ||
| 514:"INVALID_ETH_INTERNAL_BALANCE", | ||
| 515:"INVALID_POST_LOAN_BALANCE", | ||
| 516:"INSUFFICIENT_ETH", | ||
| 517:"UNALLOCATED_ETH", | ||
| 518:"ETH_TRANSFER", | ||
| 519:"CANNOT_USE_ETH_SENTINEL", | ||
| 520:"TOKENS_MISMATCH", | ||
| 521:"TOKEN_NOT_REGISTERED", | ||
| 522:"TOKEN_ALREADY_REGISTERED", | ||
| 523:"TOKENS_ALREADY_SET", | ||
| 524:"TOKENS_LENGTH_MUST_BE_2", | ||
| 525:"NONZERO_TOKEN_BALANCE", | ||
| 526:"BALANCE_TOTAL_OVERFLOW", | ||
| 600:"SWAP_FEE_PERCENTAGE_TOO_HIGH", | ||
| 601:"FLASH_LOAN_FEE_PERCENTAGE_TOO_HIGH", | ||
| 602:"INSUFFICIENT_FLASH_LOAN_FEE_AMOUNT" | ||
| }; | ||
| codes = { | ||
| 0: "ADD_OVERFLOW", | ||
| 1: "SUB_OVERFLOW", | ||
| 2: "SUB_UNDERFLOW", | ||
| 3: "MUL_OVERFLOW", | ||
| 4: "ZERO_DIVISION", | ||
| 5: "DIV_INTERNAL", | ||
| 6: "X_OUT_OF_BOUNDS", | ||
| 7: "Y_OUT_OF_BOUNDS", | ||
| 8: "PRODUCT_OUT_OF_BOUNDS", | ||
| 9: "INVALID_EXPONENT", | ||
| 100: "OUT_OF_BOUNDS", | ||
| 101: "UNSORTED_ARRAY", | ||
| 102: "UNSORTED_TOKENS", | ||
| 103: "INPUT_LENGTH_MISMATCH", | ||
| 104: "ZERO_TOKEN", | ||
| 200: "MIN_TOKENS", | ||
| 201: "MAX_TOKENS", | ||
| 202: "MAX_SWAP_FEE_PERCENTAGE", | ||
| 203: "MIN_SWAP_FEE_PERCENTAGE", | ||
| 204: "MINIMUM_BPT", | ||
| 205: "CALLER_NOT_VAULT", | ||
| 206: "UNINITIALIZED", | ||
| 207: "BPT_IN_MAX_AMOUNT", | ||
| 208: "BPT_OUT_MIN_AMOUNT", | ||
| 209: "EXPIRED_PERMIT", | ||
| 300: "MIN_AMP", | ||
| 301: "MAX_AMP", | ||
| 302: "MIN_WEIGHT", | ||
| 303: "MAX_STABLE_TOKENS", | ||
| 304: "MAX_IN_RATIO", | ||
| 305: "MAX_OUT_RATIO", | ||
| 306: "MIN_BPT_IN_FOR_TOKEN_OUT", | ||
| 307: "MAX_OUT_BPT_FOR_TOKEN_IN", | ||
| 308: "NORMALIZED_WEIGHT_INVARIANT", | ||
| 309: "INVALID_TOKEN", | ||
| 310: "UNHANDLED_JOIN_KIND", | ||
| 311: "ZERO_INVARIANT", | ||
| 400: "REENTRANCY", | ||
| 401: "SENDER_NOT_ALLOWED", | ||
| 402: "PAUSED", | ||
| 403: "PAUSE_WINDOW_EXPIRED", | ||
| 404: "MAX_PAUSE_WINDOW_DURATION", | ||
| 405: "MAX_BUFFER_PERIOD_DURATION", | ||
| 406: "INSUFFICIENT_BALANCE", | ||
| 407: "INSUFFICIENT_ALLOWANCE", | ||
| 408: "ERC20_TRANSFER_FROM_ZERO_ADDRESS", | ||
| 409: "ERC20_TRANSFER_TO_ZERO_ADDRESS", | ||
| 410: "ERC20_MINT_TO_ZERO_ADDRESS", | ||
| 411: "ERC20_BURN_FROM_ZERO_ADDRESS", | ||
| 412: "ERC20_APPROVE_FROM_ZERO_ADDRESS", | ||
| 413: "ERC20_APPROVE_TO_ZERO_ADDRESS", | ||
| 414: "ERC20_TRANSFER_EXCEEDS_ALLOWANCE", | ||
| 415: "ERC20_DECREASED_ALLOWANCE_BELOW_ZERO", | ||
| 416: "ERC20_TRANSFER_EXCEEDS_BALANCE", | ||
| 417: "ERC20_BURN_EXCEEDS_ALLOWANCE", | ||
| 418: "SAFE_ERC20_CALL_FAILED", | ||
| 419: "ADDRESS_INSUFFICIENT_BALANCE", | ||
| 420: "ADDRESS_CANNOT_SEND_VALUE", | ||
| 421: "SAFE_CAST_VALUE_CANT_FIT_INT256", | ||
| 422: "GRANT_SENDER_NOT_ADMIN", | ||
| 423: "REVOKE_SENDER_NOT_ADMIN", | ||
| 424: "RENOUNCE_SENDER_NOT_ALLOWED", | ||
| 425: "BUFFER_PERIOD_EXPIRED", | ||
| 500: "INVALID_POOL_ID", | ||
| 501: "CALLER_NOT_POOL", | ||
| 502: "SENDER_NOT_ASSET_MANAGER", | ||
| 503: "USER_DOESNT_ALLOW_RELAYER", | ||
| 504: "INVALID_SIGNATURE", | ||
| 505: "EXIT_BELOW_MIN", | ||
| 506: "JOIN_ABOVE_MAX", | ||
| 507: "SWAP_LIMIT", | ||
| 508: "SWAP_DEADLINE", | ||
| 509: "CANNOT_SWAP_SAME_TOKEN", | ||
| 510: "UNKNOWN_AMOUNT_IN_FIRST_SWAP", | ||
| 511: "MALCONSTRUCTED_MULTIHOP_SWAP", | ||
| 512: "INTERNAL_BALANCE_OVERFLOW", | ||
| 513: "INSUFFICIENT_INTERNAL_BALANCE", | ||
| 514: "INVALID_ETH_INTERNAL_BALANCE", | ||
| 515: "INVALID_POST_LOAN_BALANCE", | ||
| 516: "INSUFFICIENT_ETH", | ||
| 517: "UNALLOCATED_ETH", | ||
| 518: "ETH_TRANSFER", | ||
| 519: "CANNOT_USE_ETH_SENTINEL", | ||
| 520: "TOKENS_MISMATCH", | ||
| 521: "TOKEN_NOT_REGISTERED", | ||
| 522: "TOKEN_ALREADY_REGISTERED", | ||
| 523: "TOKENS_ALREADY_SET", | ||
| 524: "TOKENS_LENGTH_MUST_BE_2", | ||
| 525: "NONZERO_TOKEN_BALANCE", | ||
| 526: "BALANCE_TOTAL_OVERFLOW", | ||
| 600: "SWAP_FEE_PERCENTAGE_TOO_HIGH", | ||
| 601: "FLASH_LOAN_FEE_PERCENTAGE_TOO_HIGH", | ||
| 602: "INSUFFICIENT_FLASH_LOAN_FEE_AMOUNT", | ||
| } | ||
|
|
||
|
|
||
| def translateError(code): | ||
| return(codes[code]) | ||
| return codes[code] | ||
|
|
||
|
|
||
| def handleException(error): | ||
| stringError = str('{}'.format(error)); | ||
| if "BAL#" in stringError: | ||
|
Comment on lines
-100
to
-101
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mixed tabs and whitespaces |
||
| code = int(stringError.split("BAL#")[1]) | ||
| balError = translateError(code); | ||
| descriptiveError = "Balancer Smart Contract threw error: " + balError; | ||
| return(descriptiveError); | ||
| else: | ||
| return(stringError); | ||
| stringError = str("{}".format(error)) | ||
| if "BAL#" in stringError: | ||
| code = int(stringError.split("BAL#")[1]) | ||
| balError = translateError(code) | ||
| descriptiveError = "Balancer Smart Contract threw error: " + balError | ||
| return descriptiveError | ||
| else: | ||
| return stringError | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| from decimal import Decimal | ||
|
|
||
|
|
||
| BONE = Decimal('1') | ||
| MIN_FEE = Decimal('0.000001') | ||
| MAX_FEE = Decimal('0.1') | ||
| INIT_POOL_SUPPLY = BONE * Decimal('100') | ||
| BONE = Decimal("1") | ||
| MIN_FEE = Decimal("0.000001") | ||
| MAX_FEE = Decimal("0.1") | ||
| INIT_POOL_SUPPLY = BONE * Decimal("100") | ||
| MIN_BOUND_TOKENS = 2 | ||
| MAX_BOUND_TOKENS = 8 | ||
| AMPLIFICATION_PARAMETER = Decimal('200') | ||
| AMPLIFICATION_PARAMETER = Decimal("200") | ||
| MIN_WEIGHT = 0.01 | ||
| _MAX_WEIGHTED_TOKENS = 100 | ||
| _MAX_IN_RATIO = 0.3 | ||
| _MAX_OUT_RATIO = 0.3 | ||
| _MAX_INVARIANT_RATIO = 3 | ||
| _MIN_INVARIANT_RATIO = 0.7 | ||
| _MIN_INVARIANT_RATIO = 0.7 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not in the docs atm, might need to add the compile step too