diff --git a/src/sourcify-chains.ts b/src/sourcify-chains.ts index 708c099aa..b1e2fe724 100644 --- a/src/sourcify-chains.ts +++ b/src/sourcify-chains.ts @@ -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, diff --git a/test/chains/chain-tests.js b/test/chains/chain-tests.js index 755fa0835..1a5d25f0a 100644 --- a/test/chains/chain-tests.js +++ b/test/chains/chain-tests.js @@ -1407,7 +1407,7 @@ describe("Test Supported Chains", function () { ["shared/WithImmutables.sol"], "shared/withImmutables.metadata.json" ); - + // The Root Network Porcini (Testnet) verifyContract( "0x225F2cD344c61152F8E7200E62e03dEfD683f2c4", @@ -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 // ////////////////////// diff --git a/test/chains/sources/296/1_Storage.metadata.json b/test/chains/sources/296/1_Storage.metadata.json new file mode 100644 index 000000000..c73be25f4 --- /dev/null +++ b/test/chains/sources/296/1_Storage.metadata.json @@ -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} diff --git a/test/chains/sources/296/1_Storage.sol b/test/chains/sources/296/1_Storage.sol new file mode 100644 index 000000000..d292c7e52 --- /dev/null +++ b/test/chains/sources/296/1_Storage.sol @@ -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; + } +} diff --git a/test/chains/sources/296/WithImmutables.metadata.json b/test/chains/sources/296/WithImmutables.metadata.json new file mode 100644 index 000000000..140cdf1d0 --- /dev/null +++ b/test/chains/sources/296/WithImmutables.metadata.json @@ -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} diff --git a/test/chains/sources/296/WithImmutables.sol b/test/chains/sources/296/WithImmutables.sol new file mode 100644 index 000000000..d920e6cdd --- /dev/null +++ b/test/chains/sources/296/WithImmutables.sol @@ -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; + } +} \ No newline at end of file