Skip to content
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

Feat/modularize #407

Merged
merged 149 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
0d79109
feat: WitnetBytecodes.class()
guidiaz Nov 6, 2023
232944d
refactor: WitnetRequestFactory, WitnetRequestTemplate
guidiaz Nov 6, 2023
089dd5f
feat: WitnetRequestBoard.{class(), factory(), registry()}
guidiaz Nov 6, 2023
478ab18
refactor: WitnetRandomness
guidiaz Nov 6, 2023
c9ca54d
refactor: WitnetFeeds, WitnetPriceFeeds
guidiaz Nov 6, 2023
3f820b9
chore: make migration script work w/ latest refactorings
guidiaz Nov 6, 2023
d98ea96
chore: bump package version to 2.0.0
guidiaz Nov 6, 2023
2290209
feat: counter-factually bind core artifacts
guidiaz Nov 9, 2023
59a163f
chore: deprecate WPR
guidiaz Nov 9, 2023
c9f68cd
chore/feat: refactor contracts folder and impl counter-factual binding
guidiaz Nov 9, 2023
cc601b8
chore: refactor app-oracles
guidiaz Nov 9, 2023
efde9c2
feat: support counter-factual bindings on migrations
guidiaz Nov 9, 2023
a2918ef
feat: implement create2/3 address vanity generators
guidiaz Nov 9, 2023
1ed8756
chore: bump package version to 2.0.1
guidiaz Nov 9, 2023
d986cc8
feat: improve recovery of counter factual proxy addresses
guidiaz Nov 9, 2023
29a9609
feat: auto-save exportable abis when upgraded
guidiaz Nov 9, 2023
5d401ff
chore: add exportable abis
guidiaz Nov 9, 2023
8618481
chore: improve migrations logs
guidiaz Nov 9, 2023
026bbe9
chore: bump solc version to 0.8.22
guidiaz Nov 9, 2023
83785a0
fix: avoid addresses to be written on dryruns
guidiaz Nov 9, 2023
c7d7506
feat: add support to new radon string operators
guidiaz Nov 14, 2023
3c03201
feat: link WRB back from the WRF
guidiaz Nov 17, 2023
941a574
feat: implement class() on WR and WPF
guidiaz Nov 17, 2023
8cfe49c
chore: refactor+deprecates on IWitnetRequestBoard
guidiaz Nov 17, 2023
bbe087b
feat: modeling data request callbacks
guidiaz Nov 17, 2023
020c682
refactor: UsingWitnet
guidiaz Nov 17, 2023
692db6a
chore: move UsingWitnet to contracts/apps
guidiaz Nov 17, 2023
3acfe73
feat: extend UsingWitnet use cases
guidiaz Nov 17, 2023
129671e
feat: abstract WitnetConsumer use cases
guidiaz Nov 17, 2023
03201dd
refactor: WitnetBoardData* -> WitnetRequestBoardData*
guidiaz Nov 17, 2023
0788733
refactor: WRBD.__* -> WRBD.__seek*
guidiaz Nov 17, 2023
420d285
feat: implement WRB.burnQuery
guidiaz Nov 17, 2023
e3f8c25
feat: implement WRB.checkResultTraceability
guidiaz Nov 17, 2023
fc9173e
chore: deprecate old WitnetRequestBoardTrustableBoba
guidiaz Nov 17, 2023
87f112c
chore: reordering source code
guidiaz Nov 17, 2023
b9413ee
chore: deprecate IWRB.DeletedQuery
guidiaz Nov 17, 2023
c820012
feat: implement WRB.estimateBaseFee(uint,uint)
guidiaz Nov 17, 2023
c9286a8
feat: implement WRB.estimateBaseFeeWithCallback
guidiaz Nov 17, 2023
6ad43c7
feat: implement WRB.upgradeQueryReward
guidiaz Nov 17, 2023
c4cb486
chore: deprecating WRB.postRequest(address)
guidiaz Nov 17, 2023
d98e5b8
feat: deprecate Witnet.Request.gasprice
guidiaz Nov 17, 2023
3c41a25
refactor: WitnetV2.* -> Witnet.*
guidiaz Nov 23, 2023
f502d96
refactor: deprecate ballast on WitnetBytecodes
guidiaz Nov 23, 2023
f91d4d0
refactor: IWRB.read* -> IWRB.getQuery*
guidiaz Nov 23, 2023
9827c14
refactor: deprecate ballast on WitnetRequestBoard
guidiaz Nov 23, 2023
879bfc4
refactor: IWRB events
guidiaz Nov 23, 2023
30fd3f4
feat: implement query callbacks from the WRB
guidiaz Nov 23, 2023
87e8f29
feat: 5-param Witnet.RadonSLA -> 2-param WitnetV2.RadonSLA
guidiaz Nov 23, 2023
dc79d52
feat: implement posting of RAD raw bytecodes
guidiaz Nov 23, 2023
e737002
refactor: postpone dispute of queries to v2.1+
guidiaz Nov 23, 2023
f83f37f
chore: polish contract/apps
guidiaz Nov 23, 2023
77bee1d
refactor: Witnet*.class() -> Witnet*.specs()
guidiaz Nov 23, 2023
14cbe74
feat: Witnet*.class(): string
guidiaz Nov 23, 2023
f562eec
feat: contracts/apps/UsingWitnetRandomenss
guidiaz Nov 23, 2023
419ccac
fix: missing from upon WRB.postRequest
guidiaz Nov 24, 2023
94ac38c
fix: packing/unpacking of WitnetV2.RadonSLA
guidiaz Nov 24, 2023
20d58b2
chore: optimize WitnetRandomnes
guidiaz Nov 24, 2023
93a5ff1
refactor: WRBData.numQueries -> WRBData.nonce
guidiaz Nov 24, 2023
da7e40c
refactor: Witnet.QueryStatus.Deleted -> Witnet.QueryStatus.Delivered
guidiaz Nov 25, 2023
1480638
feat: declare UsingWitnet contracts to be throwers of WRB events
guidiaz Nov 25, 2023
846bebe
test/feat: polish callbacks implementation
guidiaz Nov 25, 2023
b6eb347
chore: reorder methods on IWRB
guidiaz Nov 25, 2023
7c2c088
refactor: *Query* events -> *WitnetQuery*
guidiaz Nov 25, 2023
edea9e8
refactor: IWRB.checkResult* -> IWRB.getQuery*
guidiaz Nov 25, 2023
9018436
refactor: IWitnetConsumer, Witnet.Query*, Witnet.Request, Witnet.Resp…
guidiaz Nov 28, 2023
fce673d
refactor: polish *WitnetRequestBoard*
guidiaz Nov 28, 2023
a2e6042
feat: optimize WitnetRequestBoardTrustableBase
guidiaz Nov 28, 2023
44723a8
chore: arrange contract/apps/* to latest changes
guidiaz Nov 28, 2023
88065dc
refactor: changes on Witnet.* -> WitnetV2.*
guidiaz Nov 28, 2023
eb7c61b
chore: IWitnetRequestBoard -> V2/IWitnetRequestBoard
guidiaz Nov 28, 2023
b50c8f6
chore: restoring Witnet.* v0.7 structs
guidiaz Nov 28, 2023
2d970fc
chore: IWitnetRequestBoardReporter -> V2/IWitnetRequestBoardReporter
guidiaz Nov 28, 2023
ddab6cf
feat: WRBTrustableBase.ddrTag()
guidiaz Nov 28, 2023
565c3bc
refactor: WRB.ddrTag() -> WRB.channel()
guidiaz Nov 29, 2023
cd14024
feat: add mocking contracts
guidiaz Nov 29, 2023
b4f7b71
chore: refactor Witnet*Mock -> WitnetMocked*
guidiaz Nov 29, 2023
1ba0496
chore: add disclaimer to mocked contracts
guidiaz Nov 29, 2023
ea8613f
feat: deprecate WitnetV2.RadonSLA.witnessingCollateralRatio
guidiaz Nov 30, 2023
ff0e351
chore: refactor UsingWitnetRandomness internal methods
guidiaz Nov 30, 2023
b8e74c8
chore: refactor UsingWitnet internal methods
guidiaz Nov 30, 2023
0d9fc0c
feat: UsingWitnet._witnetBaseFeeOverheadPercentage()
guidiaz Dec 1, 2023
71e7973
refactor: IWRB.estimateQueryEarnings -> IWRBReporter.estimateQueryEar…
guidiaz Dec 1, 2023
935395d
refactor: remove posting logic from UsingWitnet & WitnetConsumer
guidiaz Dec 1, 2023
1099a66
feat(libs): add support to new radon operators
guidiaz Dec 12, 2023
153f486
feat(libs): add support to new radon operators
guidiaz Jan 12, 2024
bc0bd92
chore: fmt!
guidiaz Jan 12, 2024
9713d61
feat(libs): add/refactor result error codes
guidiaz Jan 24, 2024
6917348
feat(libs): add ResultErrorCodes helper methods
guidiaz Jan 24, 2024
bfa5696
feat(libs): adopt new rules for decoding errored results
guidiaz Jan 24, 2024
db0b300
feat: modularize package
guidiaz Feb 1, 2024
8bf74ff
chore: revisit package scripts and dependencies
guidiaz Feb 1, 2024
862449c
chore: refactor package exports
guidiaz Feb 5, 2024
c3f40c4
feat: support concurrent migrations
guidiaz Feb 5, 2024
ba07f22
chore: upgrade contracts to openzeppelin v5.0.1
guidiaz Feb 5, 2024
48849a8
chore: temporary remove unadapted tests
guidiaz Feb 5, 2024
089ed32
chore: revisit tests
guidiaz Feb 5, 2024
a4769ea
chore: eslint --fix
guidiaz Feb 5, 2024
2feb370
chore: add missing .solhint rules
guidiaz Feb 5, 2024
c4abcfb
chore: prepare for hardhat
guidiaz Feb 7, 2024
1b27482
chore: refactor assets and utils package exports
guidiaz Feb 8, 2024
331ec75
fix: remove sourcePath from truffle artifacts upon package prepare
guidiaz Feb 8, 2024
74f6659
chore: deprecate WitnetRandomness
guidiaz Feb 12, 2024
b64c1e6
chore: refactor witnet.addresses file
guidiaz Feb 12, 2024
259561b
feat: customize WRB for Obscuro
guidiaz Feb 12, 2024
ac368d2
chore: deploy on ten:testnet
guidiaz Feb 12, 2024
aea3ba1
chore: revert to sequential query ids
guidiaz Feb 13, 2024
44ecab0
chore: deprecate WitnetRandomness
guidiaz Feb 13, 2024
2040fc1
chore: let WRB and WPF return legacy RadonSLAs
guidiaz Feb 13, 2024
7fe583b
chore: declare WPF to emit IWitnetRequestBoardEvents
guidiaz Feb 13, 2024
295b223
chore: prepare for hardhat verify
guidiaz Feb 13, 2024
dfb3155
feat: smarter migrations
guidiaz Feb 13, 2024
3b0fbcb
chore: refactor addresses file name
guidiaz Feb 13, 2024
72b6024
feat: create constructorArgs json file upon migrations
guidiaz Feb 13, 2024
74edd20
fix(pfs): set collateral >= 20 wit as default
guidiaz Feb 13, 2024
4ad5d05
chore: move in WitnetPriceSolverBase
guidiaz Feb 13, 2024
581daf6
feat: export gas and gasPrice on hardhat networks config
guidiaz Feb 13, 2024
6b05a6d
chore: export IWitnetPriceSolver artifact
guidiaz Feb 13, 2024
550ee8b
feat: populate constructorArgs files on migrations
guidiaz Feb 13, 2024
71488cc
fix(pfs): default sla params
guidiaz Feb 13, 2024
1467303
chore: refactor WPF as core artifact
guidiaz Feb 14, 2024
b6e1a08
chore: fmt!
guidiaz Feb 14, 2024
e91874f
chore: refactor *Witnet*Bytecodes -> *Witnet*RequestBytecodes
guidiaz Feb 14, 2024
c61b291
chore: refactor WitnetRequestBoard -> WitnetOracle
guidiaz Feb 14, 2024
7aebf47
chore: depracate unused interfaces
guidiaz Feb 14, 2024
67ac34a
chore: replace V2/interfaces
guidiaz Feb 14, 2024
5afd7bd
chore: refactor exported artifact IWitnetPriceSolver -> WitnetPriceFe…
guidiaz Feb 14, 2024
167ea94
chore: bind package git repository to branch 2.0.x
guidiaz Feb 14, 2024
9159fe0
chore: revisit package deps
guidiaz Feb 14, 2024
396ed44
chore: README.md
guidiaz Feb 14, 2024
4470c9a
fix(pfs): set default sla upon first init
guidiaz Feb 14, 2024
43f0008
fix(patterns): upgradables codehash cannot be snapshot at constructor
guidiaz Feb 14, 2024
ae0f1cb
feat: override class() on all logic contracts
guidiaz Feb 15, 2024
0637a5d
fix: network config on hardhat
guidiaz Feb 15, 2024
501f0e6
chore: redeploy on ethereum:sepolia ten:testnet
guidiaz Feb 15, 2024
2181001
chore: small fixes
guidiaz Feb 16, 2024
9185e00
chore: pnpm lock file instead of yarn's
guidiaz Feb 16, 2024
c569a9f
chore: move to node v20 on ci/cd workflows
guidiaz Feb 16, 2024
c6d6623
chore: remove unused dependencies
guidiaz Feb 16, 2024
2b3004e
chore: deprecate IWitnetRequest, ERC165
guidiaz Feb 16, 2024
bfe6942
chore: optimize WRB storage footprint (1/2)
guidiaz Feb 16, 2024
e782ac1
chore: chore: optimize WRB storage footprint (2/2)
guidiaz Feb 16, 2024
cbf46f6
fix: avoid queries w/ SLA collateral <20wit
guidiaz Feb 16, 2024
ace3cc8
chore: attend pr review comments
guidiaz Feb 16, 2024
320486f
chore: rearrange singleton addresses
guidiaz Feb 16, 2024
82d3714
chore: fully deprecate SLA refs in bytecodes registry
guidiaz Feb 19, 2024
962c89d
feat: contracts verification scripts
guidiaz Feb 19, 2024
c034491
fix: package prepare script
guidiaz Feb 19, 2024
f2f9e53
chore: update ci/cd actions to use pnpm instead of npm/yarn
guidiaz Feb 19, 2024
8224cb0
chore: fmt!
guidiaz Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install dependencies
run: |
npm install
pnpm install
- name: Check format
run: |
npm run fmt
pnpm run fmt
- name: Compile solidity contracts
run: |
npm run compile
pnpm run compile
- name: Run tests
run: |
npm run test
pnpm run test
25 changes: 25 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish NPM package

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{SECRETS.NPM_TOKEN}}
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
node_modules/

artifacts/
build/
coverage/
coverage.json
flattened/**
cache/
flattened/
node_modules/

.env
.idea
.vscode

yarn.lock
yarn-error.log
package-lock.json

*.tmp
.old
4 changes: 4 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
">=0.6.0 <0.9.0"
],
"constructor-syntax": "warn",
"custom-errors": "off",
"explicit-types": "off",
"func-param-name-mixedcase": "warn",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"immutable-vars-naming": "off",
"modifier-name-mixedcase": "warn",
"no-empty-blocks": "off",
"no-inline-assembly": "off",
"no-global-import": "off",
"var-name-mixedcase": "off",
"reason-string": [
"warn",
Expand Down
323 changes: 26 additions & 297 deletions README.md

Large diffs are not rendered by default.

127 changes: 0 additions & 127 deletions contracts/UsingWitnet.sol

This file was deleted.

15 changes: 0 additions & 15 deletions contracts/WitnetBytecodes.sol

This file was deleted.

38 changes: 0 additions & 38 deletions contracts/WitnetFeeds.sol

This file was deleted.

24 changes: 24 additions & 0 deletions contracts/WitnetOracle.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;

import "./WitnetRequestBytecodes.sol";
import "./WitnetRequestFactory.sol";
import "./interfaces/IWitnetOracle.sol";
import "./interfaces/IWitnetOracleEvents.sol";

/// @title Witnet Request Board functionality base contract.
/// @author The Witnet Foundation.
abstract contract WitnetOracle
is
IWitnetOracle,
IWitnetOracleEvents
{
function class() virtual external view returns (string memory) {
return type(WitnetOracle).name;
}
function channel() virtual external view returns (bytes4);
function factory() virtual external view returns (WitnetRequestFactory);
function registry() virtual external view returns (WitnetRequestBytecodes);
function specs() virtual external view returns (bytes4);
}
30 changes: 14 additions & 16 deletions contracts/WitnetPriceFeeds.sol
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;
pragma solidity >=0.7.0 <0.9.0;

import "ado-contracts/contracts/interfaces/IERC2362.sol";
import "./interfaces/V2/IWitnetPriceFeeds.sol";
import "./interfaces/V2/IWitnetPriceSolverDeployer.sol";
import "./WitnetFeeds.sol";
import "./apps/WitnetFeeds.sol";

import "./interfaces/IWitnetPriceFeeds.sol";
import "./interfaces/IWitnetPriceSolverDeployer.sol";

/// @title WitnetPriceFeeds: Price Feeds live repository reliant on the Witnet Oracle blockchain.
/// @author The Witnet Foundation.
abstract contract WitnetPriceFeeds
is
IERC2362,
WitnetFeeds,
IWitnetPriceFeeds,
IWitnetPriceSolverDeployer,
WitnetFeeds
{
constructor(WitnetRequestBoard _wrb)
WitnetFeeds(
_wrb,
WitnetV2.RadonDataTypes.Integer,
"Price-"
)
IWitnetPriceSolverDeployer
{
constructor()
WitnetFeeds(Witnet.RadonDataTypes.Integer, "Price-")
{}
}

}
25 changes: 0 additions & 25 deletions contracts/WitnetRandomness.sol

This file was deleted.

File renamed without changes.
Loading