Skip to content

feat(pulse-sdk-solidity): Create Pulse solidity SDK #2667

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
730 changes: 461 additions & 269 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ packages:
- target_chains/ethereum/contracts
- target_chains/ethereum/abi_generator
- target_chains/ethereum/entropy_sdk/solidity
- target_chains/ethereum/pulse_sdk/solidity
- target_chains/ethereum/sdk/js
- target_chains/ethereum/sdk/solidity
- target_chains/ethereum/sdk/stylus/pyth-mock-solidity
Expand Down
23 changes: 23 additions & 0 deletions target_chains/ethereum/abi_generator/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ function generateAbi(contracts) {
sources,
settings: {
outputSelection,
remappings: [
// Needed for @pythnetwork/pulse-sdk-solidity since it depends on @pythnetwork/pyth-sdk-solidity
"@pythnetwork/=./node_modules/@pythnetwork/",
],
},
};

Expand All @@ -42,9 +46,28 @@ function generateAbi(contracts) {
fs.mkdirSync("abis");
}

// Report compilation failures
if (output.errors) {
// We can still generate ABIs with warnings, only throw for errors
const errors = output.errors.filter((e) => e.severity === "error");
Comment on lines +51 to +52
Copy link
Contributor Author

@tejasbadadare tejasbadadare May 8, 2025

Choose a reason for hiding this comment

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

FYI i excluded warnings due to this warning in PythAggregatorV3.sol blocking the precommit for the Pulse SDK. Turns out there is no simple way to disable solc warnings for a single line/file 🙃

image

We should enforce warnings somewhere else anyway, probably turbo test:lint and/or CI

if (errors.length > 0) {
console.error("Compilation errors:");
for (const error of errors) {
console.error(error.formattedMessage || error.message);
}
throw new Error("Compilation failed due to errors");
}
}

for (let contract of contracts) {
const contractFile = `${contract}.sol`;

if (!output.contracts[contractFile]) {
throw new Error(`Unable to produce ABI for ${contractFile}.`);
}
if (!output.contracts[contractFile][contract]) {
throw new Error(`Unable to produce ABI for ${contractFile}:${contract}.`);
}
const abi = output.contracts[contractFile][contract].abi;
fs.writeFileSync(
`abis/${contract}.json`,
Expand Down
140 changes: 0 additions & 140 deletions target_chains/ethereum/contracts/contracts/pulse/IScheduler.sol

This file was deleted.

Loading
Loading