setprotocol / set-protocol-v2 Goto Github PK
View Code? Open in Web Editor NEWSet Protocol V2
Set Protocol V2
Per OpenZeppelin's smart-contract-security-registry we likely want to submit an issue for set-protocol-v2. I'm not associated with SetProtocol visibly on Github so I can't submit this form for us.
Additionally we may also want to use the custom:security-contact
natspec tag in these contracts.
I attempted to upgrade ethers in this repo (see branch) but it looks like upgrading Typescript to 4.x is a prerequisite and can be separated from a distinct ethers upgrade PR
I'm attempting to use set.js
from index-ui
. I'm encountering:
./node_modules/@setprotocol/set-protocol-v2/dist/utils/common/adapterUtils.js
Module not found: Can't resolve 'ethers/lib/utils' in '/Users/rootulp/git/index-ui/node_modules/@setprotocol/set-protocol-v2/dist/utils/common'
which comes from this line.
set-protocol-v2 declares a direct dependency on ethers here so I'm not sure why this dependency isn't being provided when I add a dependency on set.js
from the index-ui
package.
I'm attempting to use master of this package from index-ui via yarn link
. I've built set-protocol-v2 successfully. However, when I start the React dev server in index-ui, I observe:
../set-protocol-v2/dist/utils/contracts/index.js
Module not found: Can't resolve '../../typechain/AGIMigrationWrapAdapter' in '/Users/rootulp/git/index-coop/set-protocol-v2/dist/utils/contracts'
It appears the requested file is actually one directory above where it is being searched for in dist
.
~/git/index-coop/set-protocol-v2/dist/utils/contracts on master ····················································
❯ ls
aave.js axieInfinity.js compound.js index.js singularityNet.js uniswapV3.js
aaveV2.js balancer.js curve.js kyberV3.js uniswap.js yearn.js
~/git/index-coop/set-protocol-v2/dist/utils/contracts on master ····················································
❯ ls ../../typechain
commons.js factories index.js
~/git/index-coop/set-protocol-v2/dist/utils/contracts on master ····················································
❯ ls ../../../typechain
AGIMigrationWrapAdapter.d.ts IPriceOracle.d.ts
... <rest of output truncated>
However, in the original source, the line that defines this correctly resolves type definitions because set-protocol-v2/typechain/AGIMigrationWrapAdapter.d.ts
exists
set-protocol-v2/utils/contracts/index.ts
Line 15 in a80eb4c
So it looks like something funky is happening in the packaging of dist
. Apologizes if this issue only occurs during development time and would go away if I added a dependency on set-protocol-v2
once a release is cut
Hello! I'm facing issue with UniswapPairPriceAdapter. I've add the pools but getPrice returns always false.
I think this is because of a bug in the contract.
addPool function saves into uniswapPoolsToSettings by the pool address
function addPool(address _poolAddress) external onlyOwner {
require (
!uniswapPoolsToSettings[_poolAddress].isValid,
"Uniswap pool address already added"
);
IUniswapV2Pair poolToken = IUniswapV2Pair(_poolAddress);
uniswapPoolsToSettings[_poolAddress].tokenOne = poolToken.token0();
uniswapPoolsToSettings[_poolAddress].tokenTwo = poolToken.token1();
uint256 tokenOneDecimals = ERC20(uniswapPoolsToSettings[_poolAddress].tokenOne).decimals();
uniswapPoolsToSettings[_poolAddress].tokenOneBaseUnit = 10 ** tokenOneDecimals;
uint256 tokenTwoDecimals = ERC20(uniswapPoolsToSettings[_poolAddress].tokenTwo).decimals();
uniswapPoolsToSettings[_poolAddress].tokenTwoBaseUnit = 10 ** tokenTwoDecimals;
uniswapPoolsToSettings[_poolAddress].isValid = true;
allowedUniswapPools.push(_poolAddress);
}
But getPrice function check by the assets addresses
function getPrice(address _assetOne, address _assetTwo) external view returns (bool, uint256) {
require(controller.isSystemContract(msg.sender), "Must be system contract");
bool isAllowedUniswapPoolOne = uniswapPoolsToSettings[_assetOne].isValid;
bool isAllowedUniswapPoolTwo = uniswapPoolsToSettings[_assetTwo].isValid;
// If assetOne and assetTwo are both not Uniswap pools, then return false
if (!isAllowedUniswapPoolOne && !isAllowedUniswapPoolTwo) {
return (false, 0);
}
IPriceOracle priceOracle = controller.getPriceOracle();
address masterQuoteAsset = priceOracle.masterQuoteAsset();
uint256 assetOnePriceToMaster;
if(isAllowedUniswapPoolOne) {
assetOnePriceToMaster = _getUniswapPrice(priceOracle, _assetOne, masterQuoteAsset);
} else {
assetOnePriceToMaster = priceOracle.getPrice(_assetOne, masterQuoteAsset);
}
uint256 assetTwoPriceToMaster;
if(isAllowedUniswapPoolTwo) {
assetTwoPriceToMaster = _getUniswapPrice(priceOracle, _assetTwo, masterQuoteAsset);
} else {
assetTwoPriceToMaster = priceOracle.getPrice(_assetTwo, masterQuoteAsset);
}
return (true, assetOnePriceToMaster.preciseDiv(assetTwoPriceToMaster));
}
So this will be return always false
// If assetOne and assetTwo are both not Uniswap pools, then return false
if (!isAllowedUniswapPoolOne && !isAllowedUniswapPoolTwo) {
return (false, 0);
}
Am I missing something?
I apologize if this is unique to my developer environment but... I could previously run yarn install
in this package but now I'm encountering:
$ for f in typechain/*.d.ts; do mv -- "$f" "${f%.d.ts}.ts"; done
$ tsc -p tsconfig.dist.json
typechain/commons.ts:20:5 - error TS1256: A rest element must be last in a tuple type.
20 ...EventArgsArray,
~~~~~~~~~~~~~~~~~
typechain/hardhat.ts:7:3 - error TS2305: Module '"../node_modules/@nomiclabs/hardhat-ethers/dist/src"' has no exported member 'FactoryOptions'.
7 FactoryOptions,
~~~~~~~~~~~~~~
typechain/hardhat.ts:8:3 - error TS2305: Module '"../node_modules/@nomiclabs/hardhat-ethers/dist/src"' has no exported member 'HardhatEthersHelpers'.
8 HardhatEthersHelpers as HardhatEthersHelpersBase,
~~~~~~~~~~~~~~~~~~~~
Found 3 errors.
I've rm -rf node_modules
and retried with no luck. Any ideas?
I observed the following warnings when running yarn install
:
(node:7265) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(node:7265) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
Hi, I downloaded the code and tried to compile it but I experience many issues in the default configuration for developers. It would be great if you can bring more detailed steps in the Readme file.
Error HH8: There's one or more errors in your config file:
To learn more about Hardhat's configuration, please go to https://hardhat.org/config/
For more info go to https://hardhat.org/HH8 or run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have installed hardhat and solidity, when I run yarn compile
, there is error,
Creating Typechain artifacts in directory typechain for target ethers-v5
Error: Unknown type: ICErc20
at Object.parseEvmType (/Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/parseEvmType.ts:96:9)
at parseRawAbiParameterType (/Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/abiParser.ts:284:10)
at parseRawAbiParameter (/Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/abiParser.ts:273:11)
at Array.map ()
at parseFunctionDeclaration (/Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/abiParser.ts:263:29)
at /Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/abiParser.ts:157:22
at Array.forEach ()
at Object.parse (/Users/linda/myprojects/set-protocol-v2/node_modules/typechain/src/parser/abiParser.ts:138:7)
at Ethers.transformAbiOrFullJsonFile (/Users/linda/myprojects/set-protocol-v2/node_modules/@typechain/ethers-v5/src/index.ts:86:22)
at Ethers.transformFile (/Users/linda/myprojects/set-protocol-v2/node_modules/@typechain/ethers-v5/src/index.ts:56:17)
error Command failed with exit code 1.
How can I do?
MacOS Mojave 10.14.6
solidity@6
Hardhat 2.2.1
A gas reporter diff showing Berlin ([email protected]) gas cost increases/decreases vs. Istanbul ([email protected])
Gas | Diff | Diff % | Block % | usd avg | ||
---|---|---|---|---|---|---|
AaveGovernanceAdapter | 407,847 | 0 | 0% | 3.3 % | 73.14 | |
AaveGovernanceV2Adapter | 745,996 | 0 | 0% | 6 % | 133.79 | |
AaveLendingPoolCoreMock | 135,139 | 0 | 0% | 1.1 % | 24.24 | |
AaveLendingPoolMock | 109,072 | +1,300 | +1% | 0.9 % | 19.56 | |
AaveMigrationWrapAdapter | 293,209 | +10 | 0% | 2.4 % | 52.59 | |
AaveWrapAdapter | 352,593 | +3,500 | +1% | 2.8 % | 63.24 | |
AddressArrayUtilsMock | 614,996 | 0 | 0% | 4.9 % | 110.30 | |
AirdropModule | 2,141,317 | +3,400 | 0% | 17.2 % | 384.03 | |
AmmAdapterMock | 1,558,955 | +7,800 | +1% | 12.5 % | 279.59 | |
AmmModule | 2,499,186 | +3,400 | 0% | 20.1 % | 448.21 | |
AssetLimitHook | 934,582 | +10,400 | +1% | 7.5 % | 167.61 | |
BalancerV1ExchangeAdapter | 364,538 | 0 | 0% | 2.9 % | 65.38 | |
BasicIssuanceModule | 1,600,553 | +3,406 | 0% | 12.9 % | 287.05 | |
ClaimAdapterMock | 853,556 | +3,900 | 0% | 6.9 % | 153.08 | |
ClaimModule | 2,031,250 | +1,300 | 0% | 16.3 % | 364.29 | |
Compound | 1,491,687 | 0 | 0% | 12 % | 267.52 | |
CompoundBravoGovernanceAdapter | 678,516 | 0 | 0% | 5.4 % | 121.69 | |
CompoundLeverageModule | 5,511,240 | +24,788 | 0% | 44.3 % | 988.40 | |
CompoundLikeGovernanceAdapter | 677,247 | -8 | 0% | 5.4 % | 121.46 | |
CompoundMock | 859,563 | 0 | 0% | 6.9 % | 154.16 | |
CompoundPriceOracleMock | 126,049 | 0 | 0% | 1 % | 22.61 | |
CompoundWrapAdapter | 336,982 | +24 | 0% | 2.7 % | 60.44 | |
ContractCallerMock | 287,157 | 0 | 0% | 2.3 % | 51.50 | |
Controller | 2,359,150 | +2,600 | 0% | 18.9 % | 423.10 | |
CTokenOracle | 394,346 | +1,312 | 0% | 3.2 % | 70.72 | |
CurveStakingAdapter | 266,218 | 0 | 0% | 2.1 % | 47.74 | |
CustomOracleNavIssuanceModule | 4,458,635 | +3,412 | 0% | 35.8 % | 799.63 | |
CustomSetValuerMock | 131,863 | 0 | 0% | 1.1 % | 23.65 | |
DebtIssuanceMock | 162,499 | 0 | 0% | 1.3 % | 29.14 | |
DebtIssuanceModule | 3,209,097 | +3,400 | 0% | 25.8 % | 575.53 | |
DebtModuleMock | 1,134,426 | +2,600 | 0% | 9.1 % | 203.45 | |
ExplicitERC20Mock | 417,546 | 0 | 0% | 3.4 % | 74.88 | |
GaugeControllerMock | 142,333 | 0 | 0% | 1.1 % | 25.53 | |
GeneralIndexModule | 4,404,099 | +4,700 | 0% | 35.4 % | 789.84 | |
GodModeMock | 276,333 | +1,300 | 0% | 2.2 % | 49.56 | |
GovernanceAdapterMock | 410,829 | +1,300 | 0% | 3.3 % | 73.68 | |
GovernanceModule | 1,278,191 | +3,398 | 0% | 10.3 % | 229.23 | |
IntegrationRegistry | 993,326 | +2,600 | 0% | 8 % | 178.15 | |
InvokeMock | 610,129 | 0 | 0% | 4.9 % | 109.42 | |
IssuanceModule | 1,784,058 | +3,400 | 0% | 14.3 % | 319.96 | |
KyberExchangeAdapter | 469,504 | +1,300 | 0% | 3.8 % | 84.20 | |
KyberNetworkProxyMock | 678,297 | +2,600 | 0% | 5.4 % | 121.65 | |
ManagerIssuanceHookMock | 143,371 | 0 | 0% | 1.2 % | 25.71 | |
ModuleBaseMock | 1,389,252 | +1,309 | 0% | 11.2 % | 249.15 | |
ModuleIssuanceHookMock | 917,198 | 0 | 0% | 7.4 % | 164.49 | |
NAVIssuanceCaller | 242,417 | +1,312 | +1% | 1.9 % | 43.48 | |
NAVIssuanceHookMock | 193,057 | 0 | 0% | 1.6 % | 34.62 | |
NavIssuanceModule | 4,431,016 | +3,391 | 0% | 35.6 % | 794.67 | |
OneInchExchangeAdapter | 390,352 | +2,595 | +1% | 3.1 % | 70.01 | |
OneInchExchangeMock | 431,789 | +6,790 | +2% | 3.5 % | 77.44 | |
OracleAdapterMock | 171,628 | +3,400 | +2% | 1.4 % | 30.78 | |
OracleMock | 118,287 | +2,100 | +2% | 1 % | 21.21 | |
PositionMock | 1,324,675 | 0 | 0% | 10.6 % | 237.57 | |
PreciseUnitMathMock | 592,057 | 0 | 0% | 4.8 % | 106.18 | |
PriceOracle | 1,504,261 | +9,335 | +1% | 12.1 % | 269.78 | |
ProtocolViewer | 1,365,005 | 0 | 0% | 11 % | 244.80 | |
ResourceIdentifierMock | 175,831 | 0 | 0% | 1.4 % | 31.53 | |
SetToken | 3,364,810 | +17,453 | +1% | 27 % | 603.46 | |
SetTokenCreator | 4,049,511 | +1,300 | 0% | 32.5 % | 726.25 | |
SetValuer | 630,483 | +1,300 | 0% | 5.1 % | 113.07 | |
SingleIndexModule | 3,683,558 | +8,624 | 0% | 29.6 % | 660.62 | |
SnapshotGovernanceAdapter | 293,370 | +1,301 | 0% | 2.4 % | 52.61 | |
StakingAdapterMock | 511,077 | +3,400 | +1% | 4.1 % | 91.66 | |
StakingModule | 2,788,295 | +1,300 | 0% | 22.4 % | 500.06 | |
StandardTokenMock | 742,902 | +5,100 | +1% | 6 % | 133.23 | |
StandardTokenWithFeeMock | 788,454 | +8,783 | +1% | 6.3 % | 141.40 | |
StreamingFeeModule | 1,268,166 | +3,400 | 0% | 10.2 % | 227.44 | |
SynthetixExchangeAdapter | 412,359 | 0 | 0% | 3.3 % | 73.95 | |
SynthetixExchangerMock | 427,334 | +16,500 | +4% | 3.4 % | 76.64 | |
SynthMock | 771,175 | +7,200 | +1% | 6.2 % | 138.30 | |
TradeAdapterMock | 470,384 | 0 | 0% | 3.8 % | 84.36 | |
TradeModule | 1,773,515 | +3,400 | 0% | 14.2 % | 318.07 | |
Uint256ArrayUtilsMock | 203,635 | 0 | 0% | 1.6 % | 36.52 | |
UniswapPairPriceAdapter | 1,800,887 | +32,500 | +2% | 14.5 % | 322.98 | |
UniswapV2ExchangeAdapter | 334,610 | 0 | 0% | 2.7 % | 60.01 | |
UniswapV2ExchangeAdapterV2 | 512,747 | 0 | 0% | 4.1 % | 91.96 | |
UniswapYieldHook | 933,469 | +9,417 | +1% | 7.5 % | 167.41 | |
UniswapYieldStrategy | 3,264,956 | +25,288 | +1% | 26.2 % | 585.55 | |
WrapAdapterMock | 1,119,027 | +3,900 | 0% | 9 % | 200.69 | |
WrapModule | 1,944,457 | +4,700 | 0% | 15.6 % | 348.72 | |
ZeroExApiAdapter | 799,129 | 0 | 0% | 6.4 % | 143.32 | |
ZeroExMock | 720,946 | +5,867 | +1% | 5.8 % | 129.30 |
Gas | Diff | Diff % | Calls | usd avg | ||
---|---|---|---|---|---|---|
AaveLendingPoolCoreMock | ||||||
setReserveATokenAddress | 44,263 | +1,300 | +3% | 3 | 7.94 | |
AddressArrayUtilsMock | ||||||
setStorageArray | 112,637 | +5,200 | +5% | 3 | 20.20 | |
testRemoveStorage | 24,320 | -4,250 | -15% | 2 | 4.36 | |
AirdropModule | ||||||
absorb | 193,749 | +6,418 | +3% | 12 | 34.75 | |
addAirdrop | 71,613 | +9,000 | +14% | 1 | 12.84 | |
batchAbsorb | 271,938 | -33,867 | -11% | 24 | 48.77 | |
initialize | 209,861 | +13,729 | +7% | 61 | 37.64 | |
removeAirdrop | 42,383 | 0 | 0% | 1 | 7.60 | |
updateAirdropFee | 239,748 | -17,500 | -7% | 2 | 43.00 | |
updateAnyoneAbsorb | 28,638 | +5,800 | +25% | 1 | 5.14 | |
updateFeeRecipient | 44,182 | +5,800 | +15% | 1 | 7.92 | |
AmmAdapterMock | ||||||
approve | 46,506 | +2,100 | +5% | 25 | 8.34 | |
mintTo | 68,451 | +2,600 | +4% | 25 | 12.28 | |
setMintLessThanMinimum | 43,414 | +1,300 | +3% | 4 | 7.79 | |
AmmModule | ||||||
addLiquidity | 291,846 | -78,012 | -21% | 4 | 52.34 | |
addLiquiditySingleAsset | 244,262 | -47,612 | -16% | 4 | 43.81 | |
initialize | 74,593 | +3,915 | +6% | 29 | 13.38 | |
removeLiquidity | 255,403 | -59,100 | -19% | 4 | 45.80 | |
removeLiquiditySingleAsset | 155,640 | -39,900 | -20% | 4 | 27.91 | |
AssetLimitHook | ||||||
addAssetLimit | 73,667 | +3,112 | +4% | 2 | 13.21 | |
editAssetLimit | 29,381 | +500 | +2% | 1 | 5.27 | |
removeAssetLimit | 23,241 | -1,700 | -7% | 2 | 4.17 | |
BasicIssuanceModule | ||||||
initialize | 82,627 | +5,153 | +7% | 284 | 14.82 | |
issue | 245,577 | +2,390 | +1% | 355 | 44.04 | |
redeem | 205,293 | -20,233 | -9% | 18 | 36.82 | |
ClaimAdapterMock | ||||||
mint | 144,186 | +5,517 | +4% | 18 | 25.86 | |
setRewards | 43,641 | +2,100 | +5% | 46 | 7.83 | |
ClaimModule | ||||||
addClaim | 113,654 | +10,051 | +10% | 21 | 20.38 | |
batchAddClaim | 202,033 | +5,861 | +3% | 9 | 36.23 | |
batchClaim | 211,528 | +14,133 | +7% | 15 | 37.94 | |
batchRemoveClaim | 52,330 | -9,200 | -15% | 2 | 9.39 | |
claim | 130,278 | +17,935 | +16% | 9 | 23.36 | |
initialize | 235,141 | +12,397 | +6% | 68 | 42.17 | |
removeClaim | 45,401 | +1,624 | +4% | 4 | 8.14 | |
updateAnyoneClaim | 44,665 | +6,850 | +18% | 2 | 8.01 | |
CompoundLeverageModule | ||||||
addBorrowAssets | 193,012 | +17,500 | +10% | 7 | 34.62 | |
addCollateralAssets | 160,895 | +16,400 | +11% | 7 | 28.86 | |
addCompoundMarket | 46,875 | +1,900 | +4% | 3 | 8.41 | |
componentIssueHook | 272,940 | +26,900 | +11% | 1 | 48.95 | |
componentRedeemHook | 174,525 | -2,900 | -2% | 1 | 31.30 | |
delever | 548,851 | -58,424 | -10% | 14 | 98.43 | |
deleverToZeroBorrowBalance | 485,170 | -105,700 | -18% | 12 | 87.01 | |
initialize | 592,065 | +2,492 | 0% | 31 | 106.18 | |
lever | 668,567 | -51,528 | -7% | 40 | 119.90 | |
moduleIssueHook | 183,369 | +31,300 | +21% | 2 | 32.89 | |
moduleRedeemHook | 335,551 | +7,500 | +2% | 2 | 60.18 | |
registerToModule | 67,735 | +9,300 | +16% | 1 | 12.15 | |
removeBorrowAssets | 201,806 | +2,580 | +1% | 5 | 36.19 | |
removeCollateralAssets | 132,040 | +10,080 | +8% | 5 | 23.68 | |
removeCompoundMarket | 14,639 | -100 | -1% | 2 | 2.63 | |
sync | 282,410 | +5,367 | +2% | 6 | 50.65 | |
updateAllowedSetToken | 45,761 | +2,454 | +6% | 43 | 8.21 | |
updateAnySetAllowed | 46,997 | +2,600 | +6% | 4 | 8.43 | |
CompoundMock | ||||||
initializeModuleOnSet | 60,559 | +1,600 | +3% | 1 | 10.86 | |
testInvokeBorrow | 248,100 | +15,880 | +7% | 5 | 44.50 | |
testInvokeEnterMarkets | 127,227 | +15,500 | +14% | 8 | 22.82 | |
testInvokeExitMarket | 71,217 | +9,800 | +16% | 1 | 12.77 | |
testInvokeMintCEther | 143,714 | +7,600 | +6% | 1 | 25.77 | |
testInvokeMintCToken | 167,177 | -700 | 0% | 1 | 29.98 | |
testInvokeRedeem | 158,165 | +2,000 | +1% | 1 | 28.37 | |
testInvokeRedeemUnderlying | 158,758 | +2,000 | +1% | 1 | 28.47 | |
testInvokeRepayBorrowCEther | 136,187 | +3,500 | +3% | 1 | 24.42 | |
testInvokeRepayBorrowCToken | 159,070 | -2,800 | -2% | 1 | 28.53 | |
CompoundPriceOracleMock | ||||||
setUnderlyingPrice | 38,966 | +1,478 | +4% | 27 | 6.99 | |
ContractCallerMock | ||||||
invoke | 342,752 | -47,225 | -12% | 2 | 61.47 | |
Controller | ||||||
addFactory | 93,839 | +5,800 | +7% | 24 | 16.83 | |
addFee | 52,148 | +5,173 | +11% | 231 | 9.35 | |
addModule | 78,978 | +3,998 | +5% | 252 | 14.16 | |
addResource | 113,866 | +6,050 | +6% | 18 | 20.42 | |
addSet | 94,229 | +5,800 | +7% | 12 | 16.90 | |
editFee | 20,718 | +3,100 | +18% | 6 | 3.72 | |
editFeeRecipient | 30,226 | -200 | -1% | 4 | 5.42 | |
initialize | 176,783 | +7,812 | +5% | 330 | 31.70 | |
removeFactory | 22,020 | -1,300 | -6% | 6 | 3.95 | |
removeModule | 25,094 | -1,849 | -7% | 26 | 4.50 | |
removeResource | 25,120 | -1,719 | -6% | 8 | 4.51 | |
removeSet | 22,258 | -1,358 | -6% | 13 | 3.99 | |
CustomOracleNavIssuanceModule | ||||||
addReserveAsset | 90,348 | +7,712 | +9% | 3 | 16.20 | |
editFeeRecipient | 42,808 | +7,200 | +20% | 3 | 7.68 | |
editManagerFee | 47,259 | +8,250 | +21% | 4 | 8.48 | |
editPremium | 47,479 | +7,900 | +20% | 3 | 8.52 | |
initialize | 373,792 | +26,719 | +8% | 117 | 67.04 | |
issue | 307,272 | -9,817 | -3% | 23 | 55.11 | |
issueWithEther | 320,872 | -13,738 | -4% | 16 | 57.55 | |
redeem | 308,471 | -13,943 | -4% | 23 | 55.32 | |
redeemIntoEther | 336,458 | -32,830 | -9% | 13 | 60.34 | |
removeReserveAsset | 30,613 | +956 | +3% | 3 | 5.49 | |
CustomSetValuerMock | ||||||
setValuation | 44,151 | +2,100 | +5% | 8 | 7.92 | |
DebtIssuanceMock | ||||||
initialize | 76,490 | +3,565 | +5% | 31 | 13.72 | |
DebtIssuanceModule | ||||||
initialize | 168,150 | +12,714 | +8% | 62 | 30.16 | |
issue | 333,210 | -21,051 | -6% | 39 | 59.76 | |
redeem | 342,073 | -36,585 | -10% | 21 | 61.35 | |
registerToIssuanceModule | 108,942 | +9,212 | +9% | 6 | 19.54 | |
unregisterFromIssuanceModule | 29,371 | +56 | 0% | 2 | 5.27 | |
updateFeeRecipient | 45,922 | +5,112 | +13% | 3 | 8.24 | |
updateIssueFee | 47,649 | +7,112 | +18% | 3 | 8.55 | |
updateRedeemFee | 47,658 | +7,112 | +18% | 3 | 8.55 | |
DebtModuleMock | ||||||
addDebt | 158,544 | -4,800 | -3% | 27 | 28.43 | |
initialize | 148,694 | +8,912 | +6% | 33 | 26.67 | |
ERC20 | ||||||
approve | 45,760 | +1,933 | +4% | 386 | 8.21 | |
transfer | 75,013 | +485 | +1% | 138 | 13.45 | |
ExplicitERC20Mock | ||||||
transferFrom | 52,210 | -1,871 | -3% | 3 | 9.36 | |
GaugeControllerMock | ||||||
addGaugeType | 44,039 | +1,297 | +3% | 4 | 7.90 | |
GeneralIndexModule | ||||||
initialize | 224,977 | +9,040 | +4% | 5 | 40.35 | |
raiseAssetTargets | 81,266 | +8,250 | +11% | 4 | 14.57 | |
setCoolOffPeriods | 114,147 | +13,600 | +14% | 3 | 20.47 | |
setExchanges | 89,592 | +9,550 | +12% | 6 | 16.07 | |
setTradeMaximums | 84,620 | +10,216 | +14% | 6 | 15.18 | |
startRebalance | 170,047 | +17,452 | +11% | 21 | 30.50 | |
trade | 365,998 | -33,832 | -8% | 59 | 65.64 | |
tradeRemainingWETH | 286,619 | -58,663 | -17% | 9 | 51.40 | |
updateAnyoneTrade | 62,511 | +7,900 | +14% | 2 | 11.21 | |
updateRaiseTargetPercentage | 62,450 | +8,700 | +16% | 9 | 11.20 | |
updateTraderStatus | 77,660 | +8,612 | +12% | 8 | 13.93 | |
GodModeMock | ||||||
initialize | 60,493 | +1,600 | +3% | 1 | 10.85 | |
transferTokens | 60,829 | +7,488 | +14% | 1 | 10.91 | |
GovernanceAdapterMock | ||||||
delegate | 95,917 | +4,500 | +5% | 2 | 17.20 | |
GovernanceModule | ||||||
delegate | 133,202 | +13,210 | +11% | 12 | 23.89 | |
initialize | 87,686 | +5,524 | +7% | 38 | 15.73 | |
propose | 431,508 | +36,317 | +9% | 11 | 77.39 | |
register | 108,980 | +13,631 | +14% | 9 | 19.54 | |
revoke | 82,559 | +11,499 | +16% | 9 | 14.81 | |
vote | 166,648 | +24,082 | +17% | 12 | 29.89 | |
IntegrationRegistry | ||||||
addIntegration | 58,512 | +5,801 | +11% | 51 | 10.49 | |
batchAddIntegration | 97,677 | +2,911 | +3% | 18 | 17.52 | |
batchEditIntegration | 57,765 | +200 | 0% | 5 | 10.36 | |
editIntegration | 41,187 | +3,700 | +10% | 3 | 7.39 | |
removeIntegration | 18,055 | -197 | -1% | 4 | 3.24 | |
InvokeMock | ||||||
initializeModuleOnSet | 73,334 | +3,172 | +5% | 4 | 13.15 | |
testInvokeApprove | 63,353 | +10,598 | +20% | 7 | 11.36 | |
testInvokeTransfer | 50,203 | +4,438 | +10% | 2 | 9.00 | |
testInvokeUnwrapWETH | 45,557 | +6,988 | +18% | 2 | 8.17 | |
testInvokeWrapWETH | 76,719 | +10,388 | +16% | 2 | 13.76 | |
testStrictInvokeTransfer | 82,250 | +6,412 | +8% | 1 | 14.75 | |
IssuanceModule | ||||||
initialize | 95,259 | +6,495 | +7% | 22 | 17.08 | |
issue | 308,528 | -5,394 | -2% | 18 | 55.33 | |
redeem | 255,344 | -20,871 | -8% | 7 | 45.79 | |
KyberNetworkProxyMock | ||||||
addToken | 90,763 | +6,800 | +8% | 2 | 16.28 | |
ModuleBaseMock | ||||||
initializeModuleOnSet | 70,820 | +2,860 | +4% | 20 | 12.70 | |
testPayProtocolFeeFromSetToken | 69,732 | +7,200 | +12% | 1 | 12.51 | |
testTransferFrom | 51,830 | -1,867 | -3% | 3 | 9.30 | |
ModuleIssuanceHookMock | ||||||
addExternalPosition | 113,984 | +348 | 0% | 8 | 20.44 | |
initialize | 61,351 | +1,700 | +3% | 21 | 11.00 | |
NAVIssuanceCaller | ||||||
issue | 316,730 | -7,188 | -2% | 1 | 56.80 | |
redeem | 258,032 | -18,588 | -7% | 1 | 46.28 | |
NavIssuanceModule | ||||||
addReserveAsset | 90,342 | +7,700 | +9% | 3 | 16.20 | |
editFeeRecipient | 42,808 | +7,200 | +20% | 3 | 7.68 | |
editManagerFee | 47,259 | +8,250 | +21% | 4 | 8.48 | |
editPremium | 47,479 | +7,900 | +20% | 3 | 8.52 | |
initialize | 390,163 | +26,782 | +7% | 26 | 69.97 | |
issue | 305,673 | -11,246 | -4% | 29 | 54.82 | |
issueWithEther | 318,604 | -15,037 | -5% | 16 | 57.14 | |
redeem | 305,841 | -15,833 | -5% | 24 | 54.85 | |
redeemIntoEther | 334,191 | -34,130 | -9% | 13 | 59.93 | |
removeReserveAsset | 30,604 | +952 | +3% | 3 | 5.49 | |
OneInchExchangeMock | ||||||
addSetTokenAddress | 43,850 | +1,300 | +3% | 22 | 7.86 | |
PositionMock | ||||||
initialize | 60,633 | +1,600 | +3% | 1 | 10.87 | |
testCalculateAndEditDefaultPosition | 55,029 | +7,800 | +17% | 2 | 9.87 | |
testEditDefaultPosition | 62,889 | +4,814 | +8% | 8 | 11.28 | |
testEditExternalPosition | 120,702 | +384 | 0% | 18 | 21.65 | |
PriceOracle | ||||||
addAdapter | 61,082 | +2,020 | +3% | 5 | 10.95 | |
addPair | 49,367 | +1,900 | +4% | 3 | 8.85 | |
editMasterQuoteAsset | 30,103 | +500 | +2% | 3 | 5.40 | |
editPair | 32,244 | -200 | -1% | 3 | 5.78 | |
removeAdapter | 18,746 | -2,250 | -11% | 3 | 3.36 | |
removePair | 16,835 | -200 | -1% | 3 | 3.02 | |
SetToken | ||||||
addComponent | 67,527 | +8,166 | +14% | 31 | 12.11 | |
addExternalPositionModule | 73,390 | +8,127 | +12% | 65 | 13.16 | |
addModule | 55,396 | +5,800 | +12% | 72 | 9.93 | |
approve | 46,175 | +2,100 | +5% | 3 | 8.28 | |
burn | 47,833 | +5,550 | +13% | 2 | 8.58 | |
editDefaultPositionUnit | 35,901 | +7,991 | +29% | 33 | 6.44 | |
editExternalPositionData | 60,227 | +7,800 | +15% | 6 | 10.80 | |
editExternalPositionUnit | 60,727 | +9,819 | +19% | 61 | 10.89 | |
editPositionMultiplier | 57,076 | +12,800 | +29% | 27 | 10.24 | |
initializeModule | 63,984 | +1,123 | +2% | 313 | 11.48 | |
invoke | 64,584 | -40,249 | -38% | 5 | 11.58 | |
lock | 75,737 | +7,100 | +10% | 28 | 13.58 | |
mint | 145,059 | +8,895 | +7% | 21 | 26.02 | |
removeComponent | 37,035 | -1,500 | -4% | 3 | 6.64 | |
removeExternalPositionModule | 26,023 | +2,050 | +9% | 5 | 4.67 | |
removeModule | 55,030 | -5,521 | -9% | 43 | 9.87 | |
removePendingModule | 17,629 | +1,100 | +7% | 3 | 3.16 | |
setManager | 30,635 | -200 | -1% | 3 | 5.49 | |
transfer | 51,938 | +500 | +1% | 2 | 9.31 | |
unlock | 20,810 | +1,100 | +6% | 3 | 3.73 | |
SetTokenCreator | ||||||
create | 3,207,738 | +23,319 | +1% | 592 | 575.29 | |
SingleIndexModule | ||||||
initialize | 209,431 | +9,000 | +4% | 17 | 37.56 | |
raiseAssetTargets | 75,175 | +2,500 | +3% | 1 | 13.48 | |
setCoolOffPeriods | 119,543 | +14,421 | +14% | 9 | 21.44 | |
setExchanges | 104,201 | +13,234 | +15% | 11 | 18.69 | |
setTradeMaximums | 119,786 | +14,421 | +14% | 9 | 21.48 | |
startRebalance | 192,996 | +17,886 | +10% | 29 | 34.61 | |
trade | 335,431 | -39,758 | -11% | 37 | 60.16 | |
tradeRemainingWETH | 216,591 | -61,400 | -22% | 2 | 38.84 | |
updateAnyoneTrade | 44,659 | +5,100 | +13% | 4 | 8.01 | |
updateTraderStatus | 79,980 | +9,909 | +14% | 11 | 14.34 | |
StakingAdapterMock | ||||||
setUnstakeFee | 43,530 | +2,100 | +5% | 2 | 7.81 | |
stake | 99,263 | +2,300 | +2% | 1 | 17.80 | |
StakingModule | ||||||
componentIssueHook | 160,466 | -9,200 | -5% | 1 | 28.78 | |
componentRedeemHook | 157,398 | +6,400 | +4% | 1 | 28.23 | |
initialize | 73,692 | +3,820 | +5% | 41 | 13.22 | |
stake | 314,521 | -24,848 | -7% | 48 | 56.41 | |
unstake | 124,858 | -14,435 | -10% | 13 | 22.39 | |
StandardTokenMock | ||||||
approve | 43,984 | +1,784 | +4% | 803 | 7.89 | |
transfer | 51,470 | +471 | +1% | 146 | 9.23 | |
StandardTokenWithFeeMock | ||||||
approve | 46,308 | +2,100 | +5% | 3 | 8.31 | |
transfer | 53,901 | +1,100 | +2% | 2 | 9.67 | |
StreamingFeeModule | ||||||
accrueFee | 120,567 | +2,085 | +2% | 20 | 21.62 | |
initialize | 179,353 | +13,382 | +8% | 37 | 32.17 | |
updateFeeRecipient | 45,589 | +5,800 | +15% | 3 | 8.18 | |
updateStreamingFee | 125,062 | -3,343 | -3% | 7 | 22.43 | |
TradeModule | ||||||
initialize | 89,904 | +5,800 | +7% | 8 | 16.12 | |
trade | 302,796 | -35,429 | -10% | 35 | 54.30 | |
UniswapPairPriceAdapter | ||||||
addPool | 181,344 | +15,698 | +9% | 6 | 32.52 | |
removePool | 36,149 | -2,953 | -8% | 2 | 6.48 | |
UniswapYieldHook | ||||||
addAssetLimit | 73,667 | +3,100 | +4% | 2 | 13.21 | |
editAssetLimit | 29,381 | +500 | +2% | 1 | 5.27 | |
removeAssetLimit | 23,241 | -1,700 | -7% | 2 | 4.17 | |
UniswapYieldStrategy | ||||||
engage | 638,838 | -114,038 | -15% | 4 | 114.57 | |
initialize | 175,372 | +10,700 | +6% | 12 | 31.45 | |
reap | 710,697 | -184,068 | -21% | 1 | 127.46 | |
rebalance | 282,080 | -10,470 | -4% | 2 | 50.59 | |
rebalanceSome | 283,218 | -10,470 | -4% | 2 | 50.79 | |
WrapModule | ||||||
initialize | 77,077 | +4,226 | +6% | 8 | 13.82 | |
unwrap | 264,543 | -32,352 | -11% | 6 | 47.44 | |
unwrapWithEther | 241,406 | -36,800 | -13% | 5 | 43.29 | |
wrap | 279,536 | -46,202 | -14% | 20 | 50.13 | |
wrapWithEther | 215,568 | -47,500 | -18% | 16 | 38.66 | |
ZeroExMock | ||||||
addSetTokenAddress | 43,986 | +1,300 | +3% | 1 | 7.89 |
Option | Settings |
---|---|
solc: version | 0.6.10 |
solc: optimized | true |
solc: runs | 200 |
gas: block limit | 12,450,000 |
gas: price | 83 gwei/gas |
gas: currency/eth rate | 2160.76 usd/eth |
TSLint is deprecated in favor of ESLint therefore we should migrate this package to using ESLint.
(For reference)
Optimism client at commit dee74ef54b38750085a8cc2dfbcb67dc80d2a10f (v.0.2.x)
{
"reason": "transaction failed",
"code": "CALL_EXCEPTION",
"transactionHash": "0xbe9494df5390a72f8967907474b51d47602eac79d1a0a11fe084b2ad12e7167a",
"transaction": {
"hash": "0xbe9494df5390a72f8967907474b51d47602eac79d1a0a11fe084b2ad12e7167a",
"blockHash": "0xe713092716249246dd58126bd3f8e3bf9d83b7fb1cef6ffb8489ef9055db588b",
"blockNumber": 128,
"transactionIndex": 0,
"confirmations": 1,
"from": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"gasPrice": {
"type": "BigNumber",
"hex": "0x00"
},
"gasLimit": {
"type": "BigNumber",
"hex": "0x7a7457"
},
"to": "0xA7c59f010700930003b33aB25a7a0679C860f29c",
"value": {
"type": "BigNumber",
"hex": "0x00"
},
"nonce": 2,
"data": "0x8f6f033200000000000000000000000034b40ba116d5dec75548a9e9a8f15411461e8c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000",
"r": "0xbc0bac97cd1e75d300efe68cff010d84ee58b39115232b9ddc00da0ba46ca4f9",
"s": "0x0b9354fb0f9e668baef3eb0fda69750396190e26cea816dec5c4487499bc4178",
"v": 875,
"creates": null,
"chainId": 420
},
"receipt": {
"to": "0xA7c59f010700930003b33aB25a7a0679C860f29c",
"from": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"contractAddress": null,
"transactionIndex": 0,
"gasUsed": {
"type": "BigNumber",
"hex": "0x070d54"
},
"logsBloom": "0x00000000000000000000000000000000000000000000000000040000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008000000000000000010000400000000000000000400000000000000000000000000008000000000000000000000000010000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000002000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xe713092716249246dd58126bd3f8e3bf9d83b7fb1cef6ffb8489ef9055db588b",
"transactionHash": "0xbe9494df5390a72f8967907474b51d47602eac79d1a0a11fe084b2ad12e7167a",
"logs": [
{
"transactionIndex": 0,
"blockNumber": 128,
"transactionHash": "0xbe9494df5390a72f8967907474b51d47602eac79d1a0a11fe084b2ad12e7167a",
"address": "0x4200000000000000000000000000000000000006",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x00000000000000000000000014dc79964da2c08b23698b3d3cc7ca32193d9955",
"0x0000000000000000000000004200000000000000000000000000000000000005"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"logIndex": 0,
"blockHash": "0xe713092716249246dd58126bd3f8e3bf9d83b7fb1cef6ffb8489ef9055db588b"
}
],
"blockNumber": 128,
"confirmations": 1,
"cumulativeGasUsed": {
"type": "BigNumber",
"hex": "0x070d54"
},
"status": 0,
"byzantium": true
}
}
events have indexed keyword in BasicIssuanceModule before _issuer and _to parameter:
event SetTokenIssued(
address indexed _setToken,
address indexed _issuer,
address indexed _to,
address _hookContract,
uint256 _quantity
);
event SetTokenRedeemed(
address indexed _setToken,
address indexed _redeemer,
address indexed _to,
uint256 _quantity
);
events have no indexed keyword in CustomOracleNavIssuanceModule and NavIssuanceModule before _issuer and _to parameter:
event SetTokenNAVIssued(
ISetToken indexed _setToken,
address _issuer,
address _to,
address _reserveAsset,
address _hookContract,
uint256 _setTokenQuantity,
uint256 _managerFee,
uint256 _premium
);
event SetTokenNAVRedeemed(
ISetToken indexed _setToken,
address _redeemer,
address _to,
address _reserveAsset,
address _hookContract,
uint256 _setTokenQuantity,
uint256 _managerFee,
uint256 _premium
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.