This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension Result { | |
// Extract the value if it's a success | |
var value: Success? { | |
switch self { | |
case let .success(value): | |
return value | |
case .failure: | |
return nil | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.15; | |
import "forge-std/Script.sol"; | |
import "forge-std/Test.sol"; | |
function checkSameSign1(int256 a, int256 b) pure returns (bool sameSign) { | |
uint256 sa; | |
uint256 sb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.8.12; | |
// contains refs to hardhat console.sol and DSTest.sol contract | |
import '../utils/forge.sol'; | |
contract test is t { | |
struct Test { | |
uint256 a; | |
uint256 b; |