Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BCI-1289: Add Ownable test helper (#257)
* contracts/.gitignore: remove typechain-types * Move cairo 0.x code to oldsrc/ * Initial boilerplate for Cairo 1.0 Based on https://github.com/auditless/cairo-template * create confirmed owner contract * Remove old helix config * Add ocr2 aggregator skeleton * ownable.cairo: update storage * Scarb.toml: add starknet contract target * cairo_project.toml: add crate_roots to refer to crate deps * libraries: add access controller trait, simple write access controller * simple_write_access_controller.cairo: add constructor, rename to _check_enabled to match previous contract * simple_read_access_controller.cairo: add skeleton * aggregator.cairo: Round derives Serde so that it can be returned by dispatch * aggregator.cairo: change Round.round_id into felt252 * ocr2: add initial aggregator proxy * ocr2: partial set_config implementation, events * Scarb.toml: cairo-test needs --starknet flag * Add span hashing, implement most of set_config, part of transmit * Billing config, query functions * Implement payee management, payments and resolve some TODOs * Clean up recursion in set_payee too * Add ERC20 calls via abi dispatcher * Use Ownable in the aggregator * Re-export ownership functions * Slight cleanup * Implement withdraw_funds * Use access controllers as libraries in aggregator and proxy * Add a vendor/ directory with cairo and scarb version pinned * Remove unused files * ocr2/aggregator: clamp config digest hash, add prefix * Add withdraw_gas_all annotations around recursion * aggregator.cairo: pass signatures by reference with verify_signatures * aggregator.cairo: implement duplicate signer checking * aggregator.cairo: deref median immediately * Add the billing controller dispatch in billing access check * Handle negative values in link_available_for_payment * Tightly pack Transmission for storage cost savings * Optimize Oracle struct storage * Use the same split_felt function * Resolve more TODOs * aggregator.cairo: add TODOs to pow * contracts: add initial tests * aggregator.cairo: set _oracles_len to index after adding oracles * aggregator.cairo: read oracle before incrementing index * Aggregator: add transmitters view function * multisig.cairo: initial implementation * aggregator.cairo: add withdraw_gas_all to transmitters_ for cairo-test * contracts: add initial test_multisig * BCI-990: Update er protocol to Cairo 1.0 (#228) * rewrite uptime feed * remove partial eq * code review comments * add external functions from simplewriteaccesscontroller to aggregator + aggregator proxy contracts * get rid of parens + cairo-format * remove unnecessary traits * Fix compilation on alpha.6 * Makefile: build cairo, scarb, and contract tests * contracts.yml: run cairo tests * amarna.yml: disable amarna workflow * contracts/requirements.txt: remove cairo-lang and openzeppelin-cairo-contracts * Makefile: build and run cairo-format * lint.yml: checkout cairo for cairo-format * Makefile: assume the deps are already available in the env * Install cairo and scarb from github releases * also download cairo for format check * Fix the format check * Resolve formatter issues * Disable examples check for now since we haven't updated them yet * contracts/tests/test_multisig.cairo: add tests * contracts/ocr2/aggregator_proxy.cairo: add external round_data and latest_round_data * BCI-1188: Rewrite Link Token Cairo 1.0 (#234) * Makefile: build contracts with release profile * contracts: import account contracts * Solidity contracts are still used, moved to solidity/ * Remove oldsrc/ * StarknetValidator.test.ts: yarn format * Only install venv on CI actions that need it (startNetwork) * Ignore the rest of the vendor/ folder * contracts/emergency/sequencer_uptime_feed.cairo: spell transfer_ownership correctly * port over mock aggregator (#250) * aggregator: Resolve a couple TODOs * Extract split_felt to utils * proxy: We initialize with an initial value so it will never be 0 * aggregator: Reintroduce calculate_reimbursement * relayer: Stricter assertions on report format * contracts/ocr2/aggregator_proxy.cairo: require access for latest_round_data and round_data * contracts/libraries/simple_read_access_controller.cairo: check_access should call SimpleReadAccessController::has_access, readd comment about offchain calls * contracts/ocr2/mocks/mock_aggregator.cairo: set latest round id * Update account to use latest implementation * On rc0 it's no longer necessary to import this * Integer conversions can now be direct without going through felt252 * Use the new format for should_panic * cairo format * Test ERC677 with contract dispatch (#241) * port aggregator proxy tests to cairo-test * update to cairo-rc1.0 and 0.2.0-alpha.2 * contracts/ocr2/aggregator.cairo: fix epoch_and_round assertion * contracts/ocr2/aggregator.cairo: finalize hash with length * camelcase vars and undo delete file * fix file name * BCI-1259: Add upgradeability (#251) * contracts/ocr2/aggregator.cairo: add billing function * contracts: run cairo-format * .github/actions/install-cairo/action.yml: add action * .github/workflows/contracts.yml: use install-cairo action * add ownable test helper * add ownable functions to access controllers * rename ownership -> ownable * rename fn to should_implement_ownable * missed merge conflicts * fix merge errs * revert linting * add IOwnable to Ownable file * trailing whitespace --------- Co-authored-by: cfal <[email protected]> Co-authored-by: Blaž Hrastnik <[email protected]> Co-authored-by: Augustus <[email protected]> Co-authored-by: Calvin Wang <[email protected]> Co-authored-by: Augustus Chang <[email protected]> Co-authored-by: Calvin Wang <[email protected]>
- Loading branch information