-
Notifications
You must be signed in to change notification settings - Fork 465
DevUtils refactor into public libraries #2464
DevUtils refactor into public libraries #2464
Conversation
1223e1a
to
68241ca
Compare
|
a6d8043
to
3947d37
Compare
@@ -28,6 +32,18 @@ import { SupportedProvider, TxData } from 'ethereum-types'; | |||
import { constants } from './utils/constants'; | |||
import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info'; | |||
|
|||
const allArtifacts = { |
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.
➕
"zrxVault": "0x1941ff73d1154774d87521d2d0aaad5d19c8df60", | ||
"staking": "0x0d8b0dd11f5d34ed41d556def5f841900d5b1c6b", | ||
"stakingProxy": "0x38ef19fdf8e8415f18c307ed71967e19aac28ba1", | ||
"zrxVault": "0xc4df27466183c0fe2a5924d6ea56e334deff146a", |
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.
Why did these need to be re-deployed?
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.
These are ganache snapshot addresses. Every public library in DevUtils
is a separate deployment now, so it moves the deployer's nonce so we end up with different addresses.
@@ -0,0 +1,374 @@ | |||
/* |
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.
Did any of the logic change between the code in contracts/src/LibAssetData.sol and this, or just refactored?
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.
Mostly refactored. _getConvertibleMakerBalanceAndAssetProxyAllowance()
got added but it's just a no-op placeholder in this PR, so you'll see it again.
/// @param owner The owner of the tokens. | ||
/// @param spender The address the spender. | ||
/// @return allowance The allowance for a token, owner, and spender. | ||
function allowance(address token, address owner, address spender) |
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.
Why do we return 0 instead of reverting if the call fails?
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 library is all about very permissive interactions. Plus I figured we really don't want to revert in DevUtils if we can help 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.
Left a couple questions, but the changes look good to me 💯
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.
Looks good to me 👍
7da2d0b
to
0b372a3
Compare
3947d37
to
ebbf2f0
Compare
0b372a3
to
8635849
Compare
ebbf2f0
to
a08399d
Compare
This is the third in a series of PRs that splits #2456 into more manageable pieces.
Description
Chill, most of these files are just regenerated artifacts/wrappers.
@0x/contracts-dev-utils
:DevUtils
contract into public libraries, which get linked at deployment time.LibTransactionDecoder
contract that was introduced in Fix regression in DevUtils #2449 and folds it back intoDevUtils
.allowance()
andbalanceOf()
toLibERC20Token
._getTransferableConvertedMakerAssetAmount()
, which currently just wraps_getTransferableAssetAmount()
, but will be used for dydx maker assets in the next PR. This is necessary because dydx validation depends on the taker asset as well as the maker asset.@0x/migrations
:@0x/contract-wrappers
, even for ganache migrations.Testing instructions
Types of changes
Checklist:
[WIP]
if necessary.