-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the safeSingletonContract property from FractalContracts and BaseContracts interfaces #1660
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,13 @@ import { | |
import GnosisSafeL2Abi from '../../assets/abi/GnosisSafeL2'; | ||
import GnosisSafeProxyFactoryAbi from '../../assets/abi/GnosisSafeProxyFactory'; | ||
import { MultiSend } from '../../assets/typechain-types/usul'; | ||
import { GnosisSafeL2 } from '../../assets/typechain-types/usul/@gnosis.pm/safe-contracts/contracts'; | ||
import { buildContractCallViem } from '../../helpers/crypto'; | ||
import { SafeMultisigDAO } from '../../types'; | ||
|
||
export const safeData = async ( | ||
multiSendContract: MultiSend, | ||
safeFactoryContract: GetContractReturnType<typeof GnosisSafeProxyFactoryAbi, PublicClient>, | ||
safeSingletonContract: GnosisSafeL2, | ||
safeSingletonContract: GetContractReturnType<typeof GnosisSafeL2Abi, PublicClient>, | ||
daoData: SafeMultisigDAO, | ||
saltNum: bigint, | ||
fallbackHandler: string, | ||
|
@@ -52,7 +51,7 @@ export const safeData = async ( | |
} | ||
|
||
const predictedSafeAddress = getCreate2Address({ | ||
from: getAddress(safeFactoryContract.address), | ||
from: safeFactoryContract.address, | ||
salt: keccak256( | ||
encodePacked( | ||
['bytes', 'uint256'], | ||
|
@@ -62,10 +61,7 @@ export const safeData = async ( | |
bytecodeHash: keccak256( | ||
encodePacked( | ||
['bytes', 'uint256'], | ||
[ | ||
safeFactoryContractProxyCreationCode, | ||
hexToBigInt(getAddress(safeSingletonContract.address)), | ||
], | ||
Comment on lines
61
to
-68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the removal of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Presumably because the ethers contract.address is a |
||
[safeFactoryContractProxyCreationCode, hexToBigInt(safeSingletonContract.address)], | ||
), | ||
), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
isHex
function seems to be off and on used in conjunction with theencodeFunctionData
. is there a reason its being used in some places and not others?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viem's
encodeFunctionData()
will always return a "Hex
" string, so no need to use theisHex
function on data returned from that function.It was needed when using ethers
interface.encodeFunctionData()
, because that function just returns a plainstring
, and typescript doesn't allow plainstrings
to be passed into viem functions that are expectingHex
.As we progress through this refactor, we'll be removing all of these
isHex
checks, because we won't be using ethers any longer!It's jsut needed temporarily for now as we have both ethers and viem in the codebase.