mirror of
https://github.com/Instadapp/dsa-periphery-contract.git
synced 2024-07-29 22:27:13 +00:00
chg: variable naming !review
This commit is contained in:
parent
fa6fc47fa3
commit
31bc8bc660
|
|
@ -15,13 +15,13 @@ import {IDSA} from "./interfaces/IDSA.sol";
|
||||||
contract InstadappAdapter is EIP712 {
|
contract InstadappAdapter is EIP712 {
|
||||||
/// Structs
|
/// Structs
|
||||||
/// @dev This struct is used to encode the data for InstadappTarget.cast function.
|
/// @dev This struct is used to encode the data for InstadappTarget.cast function.
|
||||||
/// @param _targetNames The names of the targets that will be called.
|
/// @param targetNames The names of the targets that will be called.
|
||||||
/// @param _datas The data that will be sent to the targets.
|
/// @param datas The data that will be sent to the targets.
|
||||||
/// @param _origin The address that will be used as the origin of the call.
|
/// @param origin The address that will be used as the origin of the call.
|
||||||
struct CastData {
|
struct CastData {
|
||||||
string[] _targetNames;
|
string[] targetNames;
|
||||||
bytes[] _datas;
|
bytes[] datas;
|
||||||
address _origin;
|
address origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev This struct is used to encode the data that is signed by the auth address.
|
/// @dev This struct is used to encode the data that is signed by the auth address.
|
||||||
|
|
@ -39,12 +39,12 @@ contract InstadappAdapter is EIP712 {
|
||||||
/// Constants
|
/// Constants
|
||||||
/// @dev This is the typehash for the CastData struct.
|
/// @dev This is the typehash for the CastData struct.
|
||||||
bytes32 public constant CASTDATA_TYPEHASH =
|
bytes32 public constant CASTDATA_TYPEHASH =
|
||||||
keccak256("CastData(string[] _targetNames,bytes[] _datas,address _origin)");
|
keccak256("CastData(string[] targetNames,bytes[] datas,address origin)");
|
||||||
|
|
||||||
/// @dev This is the typehash for the Sig struct.
|
/// @dev This is the typehash for the Sig struct.
|
||||||
bytes32 public constant SIG_TYPEHASH =
|
bytes32 public constant SIG_TYPEHASH =
|
||||||
keccak256(
|
keccak256(
|
||||||
"Sig(CastData cast,bytes32 salt,uint256 deadline)CastData(string[] _targetNames,bytes[] _datas,address _origin)"
|
"Sig(CastData cast,bytes32 salt,uint256 deadline)CastData(string[] targetNames,bytes[] datas,address origin)"
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
|
|
@ -84,7 +84,7 @@ contract InstadappAdapter is EIP712 {
|
||||||
sigReplayProtection[salt] = true;
|
sigReplayProtection[salt] = true;
|
||||||
|
|
||||||
// Cast the call
|
// Cast the call
|
||||||
dsa.cast(castData._targetNames, castData._datas, castData._origin);
|
dsa.cast(castData.targetNames, castData.datas, castData.origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev This function is used to verify the signature.
|
/// @dev This function is used to verify the signature.
|
||||||
|
|
@ -115,7 +115,7 @@ contract InstadappAdapter is EIP712 {
|
||||||
/// @param castData The data that will be sent to the targets.
|
/// @param castData The data that will be sent to the targets.
|
||||||
/// @return bytes32 that is the hash of the CastData struct.
|
/// @return bytes32 that is the hash of the CastData struct.
|
||||||
function getHash(CastData memory castData) internal pure returns (bytes32) {
|
function getHash(CastData memory castData) internal pure returns (bytes32) {
|
||||||
return keccak256(abi.encode(CASTDATA_TYPEHASH, castData._targetNames, castData._datas, castData._origin));
|
return keccak256(abi.encode(CASTDATA_TYPEHASH, castData.targetNames, castData.datas, castData.origin));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user