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

Add chain 296 (Hedera Testnet) #1008

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 6 additions & 0 deletions src/sourcify-chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ const sourcifyChainsExtensions: SourcifyChainsExtensionsObject = {
"https://blockscout.com/xdai/mainnet/" + BLOCKSCOUT_SUFFIX,
txRegex: getBlockscoutRegex("/xdai/mainnet"),
},
"296": {
// Hedera Testnet
supported: true,
monitored: false,
contractFetchAddress: "https://hashscan.io/testnet/" + ETHERSCAN_SUFFIX,
},
"300": {
supported: true,
monitored: false,
Expand Down
20 changes: 19 additions & 1 deletion test/chains/chain-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ describe("Test Supported Chains", function () {
["shared/WithImmutables.sol"],
"shared/withImmutables.metadata.json"
);

// The Root Network Porcini (Testnet)
verifyContract(
"0x225F2cD344c61152F8E7200E62e03dEfD683f2c4",
Expand All @@ -1426,6 +1426,24 @@ describe("Test Supported Chains", function () {
"shared/withImmutables.metadata.json"
);

// Hedera Testnet
verifyContract(
"0x000000000000000000000000000000000044fE74",
"296",
"Hedera Testnet",
["296/1_Storage.sol"],
"296/1_Storage.metadata.json"
);
verifyContractWithImmutables(
"0x000000000000000000000000000000000044ff8E",
"296",
"Hedera Testnet",
["uint256"],
[42],
["296/WithImmutables.sol"],
"296/WithImmutables.metadata.json"
);

//////////////////////
// Helper functions //
//////////////////////
Expand Down
1 change: 1 addition & 0 deletions test/chains/sources/296/1_Storage.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compiler":{"version":"0.8.17+commit.8df45f5f"},"language":"Solidity","output":{"abi":[{"inputs":[],"name":"retrieve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"num","type":"uint256"}],"name":"store","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"details":"Store & retrieve value in a variable","kind":"dev","methods":{"retrieve()":{"details":"Return value ","returns":{"_0":"value of 'number'"}},"store(uint256)":{"details":"Store value in variable","params":{"num":"value to store"}}},"title":"Storage","version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"1_Storage.sol":"Storage"},"evmVersion":"london","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"1_Storage.sol":{"keccak256":"0x88c47206b5ec3d60ab820e9d126c4ac54cb17fa7396ff49ebe27db2862982ad8","license":"GPL-3.0","urls":["bzz-raw://5d1eeb01c8c10bed9e290f4a80a8d4081422a7b298a13049d72867022522cf6b","dweb:/ipfs/QmaFRC9ZtT7y3t9XNWCbDuMTEwKkyaQJzYFzw3NbeohSn5"]}},"version":1}
28 changes: 28 additions & 0 deletions test/chains/sources/296/1_Storage.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {

uint256 number;

/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}

/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
1 change: 1 addition & 0 deletions test/chains/sources/296/WithImmutables.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compiler":{"version":"0.8.17+commit.8df45f5f"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"_a","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"read","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"sign","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"WithImmutables.sol":"WithImmutables"},"evmVersion":"london","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"WithImmutables.sol":{"keccak256":"0xbee62e4af99b4199c5b0982f5da15fc58215a4d547724bc574d516df07f66dc2","urls":["bzz-raw://6d83c127e075a149ec14c6af579bc7b24955cdb7578ae7da2f253b7142d267cc","dweb:/ipfs/QmW6tdCTV7X5dd5LCKDWedbMmkurQTMi4ePx7LY3DNuLn7"]}},"version":1}
19 changes: 19 additions & 0 deletions test/chains/sources/296/WithImmutables.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pragma solidity >=0.7.0;

contract WithImmutables {
uint256 public immutable _a;

string _name;

constructor (uint256 a) {
_a = a;
}

function sign(string memory name) public {
_name = name;
}

function read() public view returns(string memory) {
return _name;
}
}