Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
ad38dcc0
Unverified
Commit
ad38dcc0
authored
Dec 13, 2022
by
mergify[bot]
Committed by
GitHub
Dec 13, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4428 from ethereum-optimism/sc/ctp-clean-station-comments
feat(ctp): clean AttestationStation comments
parents
73f374b7
bae43749
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
AttestationStation.sol
...riphery/contracts/universal/op-nft/AttestationStation.sol
+19
-20
No files found.
packages/contracts-periphery/contracts/universal/op-nft/AttestationStation.sol
View file @
ad38dcc0
...
@@ -4,19 +4,16 @@ pragma solidity 0.8.15;
...
@@ -4,19 +4,16 @@ pragma solidity 0.8.15;
import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semver.sol";
import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semver.sol";
/**
/**
* @title AttestationStation
* @title AttestationStation
* @dev Contract for creating attestations.
* @notice Where attestations live.
* @notice The AttestationStation contract is a contract for creating on chain attestations
* It has a very simple interface for creating attestations.
* This contract is not yet audited
*/
*/
contract AttestationStation is Semver {
contract AttestationStation is Semver {
/**
/**
* @notice
Struct representing data that is being attested
* @notice
Struct representing data that is being attested.
*
*
* @custom:field about Address
being attested about (not creator/msg.sender)
* @custom:field about Address
for which the attestation is about.
* @custom:field key A bytes32 key for the attestation.
* @custom:field key A bytes32 key for the attestation.
* @custom:field val The attestation as arbitrary bytes
* @custom:field val The attestation as arbitrary bytes
.
*/
*/
struct AttestationData {
struct AttestationData {
address about;
address about;
...
@@ -25,20 +22,17 @@ contract AttestationStation is Semver {
...
@@ -25,20 +22,17 @@ contract AttestationStation is Semver {
}
}
/**
/**
* @notice Maps addresses to attestations
* @notice Maps addresses to attestations. Creator => About => Key => Value.
* @dev addresses map to attestations map of
* about addresses to key/values
* key/values are a map of bytes32 to bytes
*/
*/
mapping(address => mapping(address => mapping(bytes32 => bytes))) public attestations;
mapping(address => mapping(address => mapping(bytes32 => bytes))) public attestations;
/**
/**
* @notice Emitted when Attestation is created
* @notice Emitted when Attestation is created
.
*
*
* @param creator Address that
attested
.
* @param creator Address that
made the attestation
.
* @param about Address attestation is about.
* @param about
Address attestation is about.
* @param key Key of the attestation.
* @param key
Key of the attestation.
* @param val Value of the attestation.
* @param val
Value of the attestation.
*/
*/
event AttestationCreated(
event AttestationCreated(
address indexed creator,
address indexed creator,
...
@@ -47,24 +41,29 @@ contract AttestationStation is Semver {
...
@@ -47,24 +41,29 @@ contract AttestationStation is Semver {
bytes val
bytes val
);
);
/**
* @custom:semver 0.0.1
*/
constructor() Semver(0, 0, 1) {}
constructor() Semver(0, 0, 1) {}
/**
/**
* @notice
Attest to the given data
.
* @notice
Allows anyone to create attestations
.
*
@dev Attests to the given data from the sender.
*
* @param
_attestations The
array of attestation data.
* @param
_attestations An
array of attestation data.
*/
*/
function attest(AttestationData[] memory _attestations) public {
function attest(AttestationData[] memory _attestations) public {
uint256 length = _attestations.length;
uint256 length = _attestations.length;
for (uint256 i = 0; i < length; ) {
for (uint256 i = 0; i < length; ) {
AttestationData memory attestation = _attestations[i];
AttestationData memory attestation = _attestations[i];
attestations[msg.sender][attestation.about][attestation.key] = attestation.val;
attestations[msg.sender][attestation.about][attestation.key] = attestation.val;
emit AttestationCreated(
emit AttestationCreated(
msg.sender,
msg.sender,
attestation.about,
attestation.about,
attestation.key,
attestation.key,
attestation.val
attestation.val
);
);
unchecked {
unchecked {
++i;
++i;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment