diff --git a/src/utils/EncGnosisSafe.sol b/src/utils/EncGnosisSafe.sol index b454445..3f8dca8 100644 --- a/src/utils/EncGnosisSafe.sol +++ b/src/utils/EncGnosisSafe.sol @@ -36,6 +36,7 @@ library EncGnosisSafe { pure returns (bytes memory) { + // magic value for signature. bytes1 v = bytes1(uint8(1)); bytes32 r = bytes32(uint256(uint160(from))); bytes32 s; diff --git a/src/utils/ZeusScript.sol b/src/utils/ZeusScript.sol index 8ccfbe0..a5985be 100644 --- a/src/utils/ZeusScript.sol +++ b/src/utils/ZeusScript.sol @@ -204,6 +204,32 @@ abstract contract ZeusScript is Script, Test { return uint32(vm.envUint(envvar)); } + /** + * Returns a uin16 set in the current environment. + * @param key The environment key. Corresponds to a ZEUS_* env variable. + */ + function zUint16(string memory key) public view returns (uint16) { + if (updatedTypes[key] != EnvironmentVariableType.UNMODIFIED) { + return updatedUInt16s[key]; + } + + string memory envvar = envPrefix.concat(key); + return uint16(vm.envUint(envvar)); + } + + /** + * Returns a uin16 set in the current environment. + * @param key The environment key. Corresponds to a ZEUS_* env variable. + */ + function zUint8(string memory key) public view returns (uint8) { + if (updatedTypes[key] != EnvironmentVariableType.UNMODIFIED) { + return updatedUInt8s[key]; + } + + string memory envvar = envPrefix.concat(key); + return uint8(vm.envUint(envvar)); + } + /** * Returns a uin64 set in the current environment. * @param key The environment key. Corresponds to a ZEUS_* env variable.