open-dollar / od-relayer Goto Github PK
View Code? Open in Web Editor NEWdeployment for relayer
License: Other
deployment for relayer
License: Other
Problem:
token0
and token1
are unrelated to arg input, but ordered by size. When SystemCoin address changes (after new deployed), it can break test setup by changing the token order.
Todo:
Requires mocking the Chainlink sequencer feed to test scenario where the sequencer is down.
Audit
ChainlinkRelayerWithL2Validity extends ChainlinkRelayer and provides L2 sequencer check. Currently it can't be deployed with ChainlinkRelayerFactory and there is not separate factory for it, as ChainlinkRelayerFactory allows to deploy ChainlinkRelayerChild only, which is ChainlinkRelayer.
function deployChainlinkRelayer(
address _aggregator,
uint256 _staleThreshold
) external isAuthorized returns (IBaseOracle _chainlinkRelayer) {
_chainlinkRelayer = IBaseOracle(address(new ChainlinkRelayerChild(_aggregator, _staleThreshold)));
relayerId++;
relayerById[relayerId] = address(_chainlinkRelayer);
emit NewChainlinkRelayer(address(_chainlinkRelayer), _aggregator, _staleThreshold);
}
to avoid confusion now that repo containers other types of relayers
Same as Camelot issue, but for the ChainlinkRelayer
ref issue #233
https://blog.uniswap.org/uniswap-v3-math-primer
Todo:
After initializing value of liquidity pool, use following calculations to confirm correct value:
sqrtPriceX96 = sqrt(price) * 2 ** 96
# divide both sides by 2 ** 96
sqrtPriceX96 / (2 ** 96) = sqrt(price)
# square both sides
(sqrtPriceX96 / (2 ** 96)) ** 2 = price
# expand the squared fraction
(sqrtPriceX96 ** 2) / ((2 ** 96) ** 2) = price
# multiply the exponents in the denominator to get the final expression
sqrtRatioX96 ** 2 / 2 ** 192 = price
```
Required to calculate TVL deposit information
ODG mainnet camelot pool: 0xF935263c9950EB2881FF58Bd6a76c3D2564A78D5
ChainlinkRelayerWithL2Validity.getResultWithValidity function is designed to not revert, when result is not valid, it should just return false
as validity. But in case if sequencer is down, then function reverts, which may revert integrations.
function getResultWithValidity() public view override returns (uint256 _result, bool _validity) {
require(getSequencerFeedValidation(), 'SequencerDown');
(_result, _validity) = super.getResultWithValidity();
}
check access control
Oracle test for down-versioned
https://github.com/open-dollar/od-relayer/actions/runs/7278216524/job/19831929757
Encountered 1 failing test in test/e2e/SystemOracle.s.sol:OracleSetup
[FAIL. Reason: setup failed: invalid rpc url: ] setUp() (gas: 0)
Unit tests
Proxy which consumes both chainlink and teller data, and will fail to return isValid
if the prices differ by more than a certain percentage.
Related to #50
Required to calculate TVL deposit information
See here for the list of oracle addresses open-dollar/od-sdk#56
Unit tests
od-contracts has actions set up to run on PRs, but od-relayer does not.
Expected outcome:
od-relayer repo should have similar setup and Github Actions as od-contracts
use a mapping
Multiple GA tests are failing
Price reads from SystemCoinOracle are over by 1 Ether order of magnitude
Test Relayers from CamelotPool
ERC20: GRT, WETH, Link
Reference to issue #8
Modify relayer so that baseToken is read and it is not assumed the it is an 18 decimal token.
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.