From 167293a61986d448d95969aebba85a62f96e2bf0 Mon Sep 17 00:00:00 2001 From: Justin Brower Date: Thu, 21 Nov 2024 11:52:12 -0500 Subject: [PATCH] uint8 --- src/utils/ZeusScript.sol | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/utils/ZeusScript.sol b/src/utils/ZeusScript.sol index 92540c0..8ccfbe0 100644 --- a/src/utils/ZeusScript.sol +++ b/src/utils/ZeusScript.sol @@ -17,7 +17,8 @@ abstract contract ZeusScript is Script, Test { ADDRESS, STRING, BOOL, - UINT_16 + UINT_16, + UINT_8 } event ZeusEnvironmentUpdate(string key, EnvironmentVariableType internalType, bytes value); @@ -37,7 +38,8 @@ abstract contract ZeusScript is Script, Test { mapping(string => uint256) updatedUInt256s; mapping(string => uint64) updatedUInt64s; mapping(string => uint32) updatedUInt32s; - mapping(string => uint32) updatedUInt16s; + mapping(string => uint16) updatedUInt16s; + mapping(string => uint8) updatedUInt8s; mapping(string => bool) updatedBools; function impl(string memory contractName) public pure returns (string memory) { @@ -120,6 +122,17 @@ abstract contract ZeusScript is Script, Test { return value; } + function zUpdateUint8(string memory key, uint8 value) public returns (uint8) { + require( + updatedTypes[key] == EnvironmentVariableType.UNMODIFIED + || updatedTypes[key] == EnvironmentVariableType.UINT_8 + ); + updatedTypes[key] = EnvironmentVariableType.UINT_8; + updatedUInt8s[key] = value; + emit ZeusEnvironmentUpdate(key, EnvironmentVariableType.UINT_8, abi.encode(value)); + return value; + } + function zUpdate(string memory key, bool value) public returns (bool) { require( updatedTypes[key] == EnvironmentVariableType.UNMODIFIED || updatedTypes[key] == EnvironmentVariableType.BOOL