Skip to content

src: Add router and factory contracts#64

Merged
pmerkleplant merged 3 commits into
mainfrom
feat_router_and_factory
Apr 23, 2026
Merged

src: Add router and factory contracts#64
pmerkleplant merged 3 commits into
mainfrom
feat_router_and_factory

Conversation

@pmerkleplant
Copy link
Copy Markdown
Member

No description provided.

@jar-o
Copy link
Copy Markdown
Contributor

jar-o commented Apr 17, 2026

running tests locally, getting this error(?)

Failing tests:
Encountered 1 failing test in test/Runner.t.sol:LibSchnorrTest
[FAIL: vm.ffi: ffi command ["bin/schnorr", "verify", "0xcd9e5ef86f5507d722f33c38cf464847a9f9d9b3b6ee8962dffcbc5a62c59e2d", "111152381934228515415595626444103415338628090826835458543833089952094993277432", "21811480841643729370490367897939243167629827005923146460314362903928336880352", "0xe24c6067fea799a902ec4fd51bf86fd3d654f4e85a10744c376a0e94b9bdaf35", "0x3Beca9eD7D8a4B96b205790898c1e5630F1fa4e9"] exited with code 1. stderr: Error: unknown command "verify" for "schnorr"
Run 'schnorr --help' for usage.
testFuzzDifferentialOracleSuite_verifySignature(uint256[],bytes32) (runs: 0, μ: 0, ~: 0)

🦄 bin/schnorr --help
Usage:
  schnorr [command]

Available Commands:
  completion             Generate the autocompletion script for the specified shell
  construct-poke-message Print poke message
  help                   Help about any command
  sign                   Sign message with set of private keys

Flags:
  -h, --help      help for schnorr
  -v, --verbose   verbose output
      --version   version for schnorr

Use "schnorr [command] --help" for more information about a command.

@pmerkleplant
Copy link
Copy Markdown
Member Author

You seem to be using an older binary, see https://github.com/chronicleprotocol/suite/blob/main/cmd/schnorr/cmd_verify.go.

To test without the differential fuzz tests, use:

$ forge test --nmt "FuzzDifferentialOracleSuite"

Comment on lines +70 to +71
int answer = 0;
return answer;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separated into two statements to allow forge coverage to mark the function as fully tested, ie achieve 100% test coverage.

Comment thread src/ScribeRouter.sol
}

/// @inheritdoc IScribeRouter
function setScribe(address scribe_) external auth {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add a zero addr + EOA guard?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, no strong opinion either way. However, keeping in mind that only governance will have auth, ie subject to timelock and extensive spell review, I don't think we need to add those checks.

Comment thread src/ScribeFactory.sol
/**
* @dev Contract overwrite to deploy contract instances with specific naming.
*/
contract ScribeFactory_COUNTER is ScribeFactory {
Copy link
Copy Markdown
Contributor

@jar-o jar-o Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't follow instances/ pattern? guess that emerged with VAO ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah correct, I tried to not update the pattern here. IIRC instances/ evolved somewhere after scribe but before vao 🤷

Comment thread src/ScribeFactory.sol
scribe.setBar(cfg.bar);

// Rely authed and kiss tolled.
for (uint i; i < cfg.authed.length; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess its possible to plant a "pre-bricked" Scribe if cfg.authed isn't checked to not be empty. operationally more of a headache than anything I guess

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, imho bearable though taking into account how automated the deployments are nowadays.

Comment thread script/offboard/ScribeZeroValue.sol
@pmerkleplant pmerkleplant force-pushed the feat_router_and_factory branch from 8c73f90 to 0d8987d Compare April 22, 2026 13:47
@pmerkleplant
Copy link
Copy Markdown
Member Author

Force push to rebase on main.

@pmerkleplant pmerkleplant merged commit ab7b567 into main Apr 23, 2026
5 checks passed
@pmerkleplant pmerkleplant deleted the feat_router_and_factory branch April 23, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants