Skip to content

Instantly share code, notes, and snippets.

@Xanewok
Created August 28, 2024 20:51
Show Gist options
  • Save Xanewok/90d7aca888f8541081b2e7c1c703d6ca to your computer and use it in GitHub Desktop.
Save Xanewok/90d7aca888f8541081b2e7c1c703d6ca to your computer and use it in GitHub Desktop.
// file: crates/edr_solidity/examples/leak_test.rs
#[rustfmt::skip]
// Test with: $ cargo build --examples && valgrind --leak-check=full $REPOS_DIR/edr/target/debug/examples/leak_test
use edr_solidity::{
artifacts::{CompilerInput, CompilerOutput},
compiler::create_models_and_decode_bytecodes,
};
const INPUT: &str = include_str!("$REPOS_DIR/hardhat/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts/0_8/call-message/internal-calls/call-from-modifier-fails/compiler-input-solc-0.8.22-optimized-with-viair-and-runs-200.json");
const OUTPUT: &str = include_str!("$REPOS_DIR/hardhat/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts/0_8/call-message/internal-calls/call-from-modifier-fails/compiler-output-solc-0.8.22-optimized-with-viair-and-runs-200.json");
fn main() {
let input: CompilerInput = serde_json::from_str(INPUT).unwrap();
let output: CompilerOutput = serde_json::from_str(OUTPUT).unwrap();
let _abc = create_models_and_decode_bytecodes("0.8.22".to_owned(), &input, &output).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment