Skip to content

Commit

Permalink
Merge branch 'dcmt/remove-signer'
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Jan 24, 2025
2 parents 638de52 + e6d3919 commit 4b6cfee
Show file tree
Hide file tree
Showing 20 changed files with 191 additions and 148 deletions.
4 changes: 1 addition & 3 deletions script/SafeConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@ library SafeConfig {
uint256 internal constant upgradeSafeThreshold = 2;

function getUpgradeSafeSigners() internal view returns (address[] memory) {
address[] memory result = new address[](5);
address[] memory result = new address[](4);
result[0] = 0x257619B7155d247e43c8B6d90C8c17278Ae481F0; // Will
result[1] = 0xD6B66609E5C05210BE0A690aB3b9788BA97aFa60; // Duncan
if (_isMainnet()) {
result[2] = 0x5ee2a00F8f01d099451844Af7F894f26A57FCbF2; // Amir
result[3] = 0x269984C978bFA5693D5915201e4dd1B7686aA6F7; // Jacob
result[4] = 0x2b3C8B6809d3b3bb4e2a667ba5A5b4ccdAe23DA4; // Phil
} else {
result[2] = 0x9E4496adE6096b000C856219C27734F4f89A5210; // Amir
result[3] = 0x5A9d540A07a96a2bfC8a8dfd638359778C72526f; // Jacob
result[4] = 0xe982f56B645E9858e865F8335Af157e9E6e12F9e; // Phil
}
return result;
}
Expand Down
16 changes: 8 additions & 8 deletions sh/address.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
## Copyright (c) 2014 Michael Kropat - MIT License
## Copyright (c) 2013 Asymmetry Laboratories - MIT License

realpath() {
function realpath {
_resolve_symlinks "$(_canonicalize "$1")"
}

_directory() {
function _directory {
local out slsh
slsh=/
out="$1"
Expand All @@ -34,7 +34,7 @@ _directory() {
fi
}

_file() {
function _file {
local out slsh
slsh=/
out="$1"
Expand All @@ -48,7 +48,7 @@ _file() {
printf '%s\n' "$out"
}

_resolve_symlinks() {
function _resolve_symlinks {
local path pattern context
while [ -L "$1" ]; do
context="$(_directory "$1")"
Expand All @@ -61,7 +61,7 @@ _resolve_symlinks() {
printf '%s\n' "$1"
}

_escape() {
function _escape {
local out
out=''
local -i i
Expand All @@ -71,7 +71,7 @@ _escape() {
printf '%s\n' "$out"
}

_prepend_context() {
function _prepend_context {
if [ "$1" = . ]; then
printf '%s\n' "$2"
else
Expand All @@ -82,7 +82,7 @@ _prepend_context() {
fi
}

_assert_no_path_cycles() {
function _assert_no_path_cycles {
local target path

if [ $# -gt 16 ]; then
Expand All @@ -99,7 +99,7 @@ _assert_no_path_cycles() {
done
}

_canonicalize() {
function _canonicalize {
local d f
if [ -d "$1" ]; then
(CDPATH= cd -P "$1" 2>/dev/null && pwd -P)
Expand Down
16 changes: 8 additions & 8 deletions sh/checkout_settler_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
## Copyright (c) 2014 Michael Kropat - MIT License
## Copyright (c) 2013 Asymmetry Laboratories - MIT License

realpath() {
function realpath {
_resolve_symlinks "$(_canonicalize "$1")"
}

_directory() {
function _directory {
local out slsh
slsh=/
out="$1"
Expand All @@ -34,7 +34,7 @@ _directory() {
fi
}

_file() {
function _file {
local out slsh
slsh=/
out="$1"
Expand All @@ -48,7 +48,7 @@ _file() {
printf '%s\n' "$out"
}

_resolve_symlinks() {
function _resolve_symlinks {
local path pattern context
while [ -L "$1" ]; do
context="$(_directory "$1")"
Expand All @@ -61,7 +61,7 @@ _resolve_symlinks() {
printf '%s\n' "$1"
}

_escape() {
function _escape {
local out
out=''
local -i i
Expand All @@ -71,7 +71,7 @@ _escape() {
printf '%s\n' "$out"
}

_prepend_context() {
function _prepend_context {
if [ "$1" = . ]; then
printf '%s\n' "$2"
else
Expand All @@ -82,7 +82,7 @@ _prepend_context() {
fi
}

_assert_no_path_cycles() {
function _assert_no_path_cycles {
local target path

if [ $# -gt 16 ]; then
Expand All @@ -99,7 +99,7 @@ _assert_no_path_cycles() {
done
}

_canonicalize() {
function _canonicalize {
local d f
if [ -d "$1" ]; then
(CDPATH= cd -P "$1" 2>/dev/null && pwd -P)
Expand Down
12 changes: 6 additions & 6 deletions sh/common_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare -r deployer_address
declare -i current_safe_nonce
current_safe_nonce="$(cast call --rpc-url "$rpc_url" "$safe_address" 'nonce()(uint256)')"
declare -r -i current_safe_nonce
nonce() {
function nonce {
echo $((${SAFE_NONCE_INCREMENT:-0} + current_safe_nonce))
}

Expand All @@ -28,7 +28,7 @@ declare -a owners_array
IFS=';' read -r -a owners_array <<<"$owners"
declare -r -a owners_array

prev_owner() {
function prev_owner {
declare _prev_owner_inp="$1"
shift
_prev_owner_inp="$(cast to-checksum "$_prev_owner_inp")"
Expand All @@ -53,7 +53,7 @@ prev_owner() {
echo "$result"
}

target() {
function target {
declare -i operation
if (( $# > 0 )) ; then
operation="$1"
Expand Down Expand Up @@ -91,7 +91,7 @@ declare -r eip712_message_json_template='{
"refundReceiver": "0x0000000000000000000000000000000000000000",
"nonce": $nonce | tonumber'

eip712_json() {
function eip712_json {
declare -r _eip712_json_calldata="$1"
shift

Expand Down Expand Up @@ -188,7 +188,7 @@ eip712_json() {
<<<'{}'
}

eip712_struct_hash() {
function eip712_struct_hash {
declare -r calldata="$1"
shift

Expand All @@ -213,7 +213,7 @@ eip712_struct_hash() {
cast keccak "$(cast abi-encode 'foo(bytes32,address,uint256,bytes32,uint8,uint256,uint256,uint256,address,address,uint256)' "$type_hash" "$to" 0 "$(cast keccak "$calldata")" $operation 0 0 0 "$(cast address-zero)" "$(cast address-zero)" $(nonce))"
}

eip712_hash() {
function eip712_hash {
declare -r calldata="$1"
shift

Expand Down
2 changes: 1 addition & 1 deletion sh/common_safe_deployer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
retrieve_signatures() {
function retrieve_signatures {
declare -r _retrieve_signatures_prefix="$1"
shift

Expand Down
16 changes: 11 additions & 5 deletions sh/common_safe_owner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [[ -f "$saved_safe_owner" && -r "$saved_safe_owner" ]] ; then
signer="$(<"$saved_safe_owner")"
fi

contains() {
function contains {
declare -r elem="$1"
shift

Expand Down Expand Up @@ -33,7 +33,7 @@ fi

declare -r signer

sign_call() {
function sign_call {
declare -r _sign_call_struct_json="$1"
shift

Expand Down Expand Up @@ -71,15 +71,21 @@ sign_call() {
echo "$_sign_call_result"
}

save_signature() {
function save_signature {
declare -r _save_signature_prefix="$1"
shift

declare -r _save_signature_call="$1"
shift

declare -r _save_signature_signature="$1"
declare _save_signature_signature="$1"
shift
if [[ ${_save_signature_signature: -2} = '00' ]] ; then
_save_signature_signature="${_save_signature_signature:: -2}"'1b'
elif [[ ${_save_signature_signature: -2} = '01' ]] ; then
_save_signature_signature="${_save_signature_signature:: -2}"'1c'
fi
declare -r _save_signature_signature

declare -i _save_signature_operation
if (( $# > 0 )) ; then
Expand All @@ -102,7 +108,7 @@ save_signature() {
if [[ $safe_url = 'NOT SUPPORTED' ]] ; then
declare signature_file
signature_file="$project_root"/"$_save_signature_prefix"_"$chain_display_name"_"$(git rev-parse --short=8 HEAD)"_"$(tr '[:upper:]' '[:lower:]' <<<"$signer")"_$(nonce).txt
echo "$signature" >"$signature_file"
echo "$_save_signature_signature" >"$signature_file"

echo "Signature saved to '$signature_file'" >&2
else
Expand Down
18 changes: 9 additions & 9 deletions sh/confirm_new_feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
## Copyright (c) 2014 Michael Kropat - MIT License
## Copyright (c) 2013 Asymmetry Laboratories - MIT License

realpath() {
function realpath {
_resolve_symlinks "$(_canonicalize "$1")"
}

_directory() {
function _directory {
local out slsh
slsh=/
out="$1"
Expand All @@ -34,7 +34,7 @@ _directory() {
fi
}

_file() {
function _file {
local out slsh
slsh=/
out="$1"
Expand All @@ -48,7 +48,7 @@ _file() {
printf '%s\n' "$out"
}

_resolve_symlinks() {
function _resolve_symlinks {
local path pattern context
while [ -L "$1" ]; do
context="$(_directory "$1")"
Expand All @@ -61,7 +61,7 @@ _resolve_symlinks() {
printf '%s\n' "$1"
}

_escape() {
function _escape {
local out
out=''
local -i i
Expand All @@ -71,7 +71,7 @@ _escape() {
printf '%s\n' "$out"
}

_prepend_context() {
function _prepend_context {
if [ "$1" = . ]; then
printf '%s\n' "$2"
else
Expand All @@ -82,7 +82,7 @@ _prepend_context() {
fi
}

_assert_no_path_cycles() {
function _assert_no_path_cycles {
local target path

if [ $# -gt 16 ]; then
Expand All @@ -99,7 +99,7 @@ _assert_no_path_cycles() {
done
}

_canonicalize() {
function _canonicalize {
local d f
if [ -d "$1" ]; then
(CDPATH= cd -P "$1" 2>/dev/null && pwd -P)
Expand Down Expand Up @@ -143,7 +143,7 @@ declare -r description
declare -r setDescription_sig='setDescription(uint128,string)(string)'
declare -r authorize_sig='authorize(uint128,address,uint40)(bool)'

_compat_date() {
function _compat_date {
declare -r datestring="$1"
shift

Expand Down
Loading

0 comments on commit 4b6cfee

Please sign in to comment.