Skip to content

Commit

Permalink
uint8
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrower95 committed Nov 21, 2024
1 parent dcefd42 commit 167293a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/utils/ZeusScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 167293a

Please sign in to comment.