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

Fix/polygon mainnet #442

Merged
merged 4 commits into from
Oct 2, 2024
Merged
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
14 changes: 14 additions & 0 deletions contracts/impls/core/customs/WitnetRequestBoardTrustableBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ abstract contract WitnetRequestBoardTrustableBase
} else if (msg.sig == 0xD74803BE) {
// IWitnetRequestParser.asErrorMessage({bool,CBOR}) --> IWitnetRequestBoardDeprecating.asErrorMessage({bool,WitnetCBOR.CBOR})
_newSig = IWitnetRequestBoardDeprecating.asErrorMessage.selector;
} else if (msg.sig == 0x109A0E3C) {
// IWitnetRequestParser.asString({bool,CBOR}) --> IWitnetRequestBoardDeprectating.asString({bool,WitnetCBOR.CBOR})
_newSig = IWitnetRequestBoardDeprecating.asString.selector;
}
if (_newSig != msg.sig) {
address _self = address(this);
Expand Down Expand Up @@ -782,6 +785,17 @@ abstract contract WitnetRequestBoardTrustableBase
_resultError.reason
);
}

/// Decode a string value from a Witnet.Result as a `string` value.
/// @param _result An instance of Witnet.Result.
/// @return The decoded `string` from the Witnet.Result.
function asString(Witnet.Result memory _result)
external pure
override
returns (string memory)
{
return _result.asText();
}

/// Decode a natural numeric value from a Witnet.Result as a `uint` value.
/// @param _result An instance of Witnet.Result.
Expand Down
5 changes: 5 additions & 0 deletions contracts/interfaces/IWitnetRequestBoardDeprecating.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ interface IWitnetRequestBoardDeprecating {
/// @return A tuple containing the `CBORValue.Error memory` decoded from the `Witnet.Result`, plus a loggable error message.
function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ResultErrorCodes, string memory);

/// Decode a string value from a Witnet.Result as a `string` value.
/// @param _result An instance of Witnet.Result.
/// @return The decoded `string` decoded from the given Witnet.Result.
function asString(Witnet.Result memory _result) external pure returns (string memory);

/// Decode a natural numeric value from a Witnet.Result as a `uint` value.
/// @param _result An instance of Witnet.Result.
/// @return The `uint` decoded from the Witnet.Result.
Expand Down
4 changes: 2 additions & 2 deletions migrations/witnet.addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@
"WitnetPriceFeedsImplementation": "0x2159610a10B4922616e9ACa66D2922AA50ea548B",
"WitnetRandomnessImplementation": "0xF1Aba51c5097487a62DA9c72fb9Aa7B0c98676C1",
"WitnetRandomnessImplementationv061": "0xc8c0d4dB2D7801D6E2A863934597cFD31689f7D5",
"WitnetRequestBoardImplementation": "0xb62C9FAd26D35D160ADC486863Ba9AFeEAab11f9",
"WitnetRequestBoardTrustableDefault": "0xF395CEeb77cE9cDc44Fd276bE5Ff307B1902D3f7",
"WitnetRequestBoardImplementation": "0xFCEA14D05e2aB69125d024A4B2fC5B15DF54E4b2",
"WitnetRequestBoardTrustableDefault": "0x11C156079B1F6585333c5aDA8856e5C56953ff3d",
"WitnetRequestFactoryImplementation": "0xc42656C501623859565C6d080a7Feb1f2B72b55a"
},
"polygon.zkevm.goerli": {
Expand Down
1 change: 0 additions & 1 deletion migrations/witnet.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ module.exports = {
network_id: 137,
skipDryRun: true,
verify: {
apiKey: process.env.ETHERSCAN_POLYGON_API_KEY,
apiUrl: "https://api.polygonscan.com/api",
explorerUrl: "https://polygonscan.com/",
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "witnet-solidity-bridge",
"version": "0.7.18",
"version": "0.7.19",
"description": "Witnet Solidity Bridge contracts for EVM-compatible chains",
"main": "",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
etherscan: process.env.ETHERSCAN_API_KEY,
moonscan: process.env.MOONSCAN_API_KEY,
optimistic_etherscan: process.env.ETHERSCAN_OPTIMISM_API_KEY,
polygonscan: process.env.POLYGONSCAN_API_KEY,
polygonscan: process.env.ETHERSCAN_POLYGON_API_KEY,
routescan: process.env.ROUTESCAN_API_KEY,
scrollscan: process.env.SCROLLSCAN_API_KEY,
},
Expand Down
Loading