Skip to content

Commit

Permalink
fix: change all occurances of moduleAddr to moduleAddress in src
Browse files Browse the repository at this point in the history
  • Loading branch information
kopy-kat committed Jul 3, 2024
1 parent 4f73a09 commit d792ff4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/DataTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct AttestationRecord {
uint48 expirationTime; // The time when the attestation expires (Unix timestamp).
uint48 revocationTime; // The time when the attestation was revoked (Unix timestamp).
PackedModuleTypes moduleTypes; // bit-wise encoded module types. See ModuleTypeLib
address moduleAddr; // The implementation address of the module that is being attested.
address moduleAddress; // The implementation address of the module that is being attested.
address attester; // The attesting account.
AttestationDataRef dataPointer; // SSTORE2 pointer to the attestation data.
SchemaUID schemaUID; // The unique identifier of the schema.
Expand Down Expand Up @@ -52,7 +52,7 @@ struct TrustedAttesterRecord {
* @dev A struct representing the arguments of the attestation request.
*/
struct AttestationRequest {
address moduleAddr; // The moduleAddr of the attestation.
address moduleAddress; // The moduleAddress of the attestation.
uint48 expirationTime; // The time when the attestation expires (Unix timestamp).
bytes data; // Custom attestation data.
ModuleType[] moduleTypes; // optional: The type(s) of the module.
Expand All @@ -62,7 +62,7 @@ struct AttestationRequest {
* @dev A struct representing the arguments of the revocation request.
*/
struct RevocationRequest {
address moduleAddr; // The module address.
address moduleAddress; // The module address.
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
Expand Down
6 changes: 3 additions & 3 deletions src/IRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ interface IRegistry is IERC7484 {
/* Attestations */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

event Revoked(address indexed moduleAddr, address indexed revoker, SchemaUID schema);
event Attested(address indexed moduleAddr, address indexed attester, SchemaUID schemaUID, AttestationDataRef indexed sstore2Pointer);
event Revoked(address indexed moduleAddress, address indexed revoker, SchemaUID schema);
event Attested(address indexed moduleAddress, address indexed attester, SchemaUID schemaUID, AttestationDataRef indexed sstore2Pointer);

error AlreadyRevoked();
error AlreadyAttested();
Expand Down Expand Up @@ -214,7 +214,7 @@ interface IRegistry is IERC7484 {
)
external
payable
returns (address moduleAddr);
returns (address moduleAddress);

/**
* In order to make the integration into existing business logics possible,
Expand Down
12 changes: 6 additions & 6 deletions src/core/AttestationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ abstract contract AttestationManager is IRegistry, ModuleManager, SchemaManager,
revert InvalidExpirationTime();
}
// caching module address.
address module = request.moduleAddr;
address module = request.moduleAddress;
AttestationRecord storage $record = $getAttestation({ module: module, attester: attester });
// If the attestation was already made for module, but not revoked, revert.
if ($record.time != ZERO_TIMESTAMP && $record.revocationTime == ZERO_TIMESTAMP) {
Expand All @@ -146,14 +146,14 @@ abstract contract AttestationManager is IRegistry, ModuleManager, SchemaManager,
revocationTime: uint48(ZERO_TIMESTAMP),
moduleTypes: request.moduleTypes.pack(),
schemaUID: schemaUID,
moduleAddr: module,
moduleAddress: module,
attester: attester,
dataPointer: sstore2Pointer
});
// SSTORE attestation to registry storage
$moduleToAttesterToAttestations[module][attester] = record;

emit Attested({ moduleAddr: module, attester: attester, schemaUID: schemaUID, sstore2Pointer: sstore2Pointer });
emit Attested({ moduleAddress: module, attester: attester, schemaUID: schemaUID, sstore2Pointer: sstore2Pointer });
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
Expand Down Expand Up @@ -207,11 +207,11 @@ abstract contract AttestationManager is IRegistry, ModuleManager, SchemaManager,
internal
returns (AttestationRecord memory record, ResolverUID resolverUID)
{
AttestationRecord storage $attestation = $moduleToAttesterToAttestations[request.moduleAddr][revoker];
AttestationRecord storage $attestation = $moduleToAttesterToAttestations[request.moduleAddress][revoker];

// SLOAD entire record. This will later be passed to the resolver
record = $attestation;
resolverUID = $moduleAddrToRecords[request.moduleAddr].resolverUID;
resolverUID = $moduleAddrToRecords[request.moduleAddress].resolverUID;

// Ensure that we aren't attempting to revoke a non-existing attestation.
if (record.dataPointer == EMPTY_ATTESTATION_REF) {
Expand All @@ -232,7 +232,7 @@ abstract contract AttestationManager is IRegistry, ModuleManager, SchemaManager,
// set revocation time to NOW
$attestation.revocationTime = _time();

emit Revoked({ moduleAddr: request.moduleAddr, revoker: revoker, schema: record.schemaUID });
emit Revoked({ moduleAddress: request.moduleAddress, revoker: revoker, schema: record.schemaUID });
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/external/examples/ERC7512Schema.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract ERC7512SchemaValidator is IExternalSchemaValidator, ERC7512 {

function validateSchema(AttestationRecord calldata attestation) public view override returns (bool valid) {
AuditSummary memory summary = abi.decode(attestation.dataPointer.sload2(), (AuditSummary));
if (summary.auditedContract.deployment != attestation.moduleAddr) {
if (summary.auditedContract.deployment != attestation.moduleAddress) {
return false;
}
if (summary.issuedAt > attestation.time) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/AttestationLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ library AttestationLib {
keccak256(
abi.encode(
ATTEST_REQUEST_TYPEHASH,
request.moduleAddr,
request.moduleAddress,
request.expirationTime,
keccak256(request.data),
keccak256(abi.encodePacked(request.moduleTypes))
Expand All @@ -102,7 +102,7 @@ library AttestationLib {
keccak256(
abi.encode(
ATTEST_REQUEST_TYPEHASH,
requests[i].moduleAddr,
requests[i].moduleAddress,
requests[i].expirationTime,
keccak256(requests[i].data),
keccak256(abi.encodePacked(requests[i].moduleTypes))
Expand All @@ -121,7 +121,7 @@ library AttestationLib {
* @return _hash the hash
*/
function hash(RevocationRequest calldata request, uint256 nonce) internal pure returns (bytes32 _hash) {
_hash = keccak256(abi.encode(REVOKE_TYPEHASH, keccak256(abi.encode(REVOKE_REQUEST_TYPEHASH, request.moduleAddr)), nonce));
_hash = keccak256(abi.encode(REVOKE_TYPEHASH, keccak256(abi.encode(REVOKE_REQUEST_TYPEHASH, request.moduleAddress)), nonce));
}

/**
Expand All @@ -137,7 +137,7 @@ library AttestationLib {
for (uint256 i; i < length; i++) {
concatinatedAttestations = abi.encodePacked(
concatinatedAttestations, // concat previous
keccak256(abi.encode(REVOKE_REQUEST_TYPEHASH, requests[i].moduleAddr))
keccak256(abi.encode(REVOKE_REQUEST_TYPEHASH, requests[i].moduleAddress))
);
}

Expand Down

0 comments on commit d792ff4

Please sign in to comment.