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
ef5f87e9
Unverified
Commit
ef5f87e9
authored
2 years ago
by
mergify[bot]
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4733 from ethereum-optimism/feat/station-1.1.0
ctp: update AttestationStation to 1.1.0
parents
528ee87d
9fbfe350
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
23 deletions
+57
-23
strong-crabs-accept.md
.changeset/strong-crabs-accept.md
+5
-0
.gas-snapshot
packages/contracts-periphery/.gas-snapshot
+14
-13
AttestationStation.t.sol
...eriphery/contracts/foundry-tests/AttestationStation.t.sol
+17
-0
AttestationStation.sol
...riphery/contracts/universal/op-nft/AttestationStation.sol
+21
-10
No files found.
.changeset/strong-crabs-accept.md
0 → 100644
View file @
ef5f87e9
---
'
@eth-optimism/contracts-periphery'
:
patch
---
Update the attestation station impl to 1.1.0
This diff is collapsed.
Click to expand it.
packages/contracts-periphery/.gas-snapshot
View file @
ef5f87e9
...
...
@@ -10,22 +10,23 @@ AssetReceiverTest:test_withdrawERC20withAmount() (gas: 182146)
AssetReceiverTest:test_withdrawERC721() (gas: 49097)
AssetReceiverTest:test_withdrawETH() (gas: 26179)
AssetReceiverTest:test_withdrawETHwithAmount() (gas: 26108)
AssetReceiverTest:test_attest_bulk() (gas: 592013)
AssetReceiverTest:test_attest_single() (gas: 539644)
OptimistTest:test_optimist_baseURI() (gas: 117016)
OptimistTest:test_optimist_burn() (gas: 77691)
AssetReceiverTest:test_attest_bulk() (gas: 611440)
AssetReceiverTest:test_attest_individual() (gas: 538514)
AssetReceiverTest:test_attest_single() (gas: 558962)
OptimistTest:test_optimist_baseURI() (gas: 116809)
OptimistTest:test_optimist_burn() (gas: 77526)
OptimistTest:test_optimist_initialize() (gas: 23095)
OptimistTest:test_optimist_is_on_allow_list() (gas: 52
822
)
OptimistTest:test_optimist_mint_already_minted() (gas: 9
9125
)
OptimistTest:test_optimist_mint_happy_path() (gas: 99
381
)
OptimistTest:test_optimist_is_on_allow_list() (gas: 52
616
)
OptimistTest:test_optimist_mint_already_minted() (gas: 9
8911
)
OptimistTest:test_optimist_mint_happy_path() (gas: 99
175
)
OptimistTest:test_optimist_mint_no_attestation() (gas: 15897)
OptimistTest:test_optimist_mint_secondary_minter() (gas: 100
782
)
OptimistTest:test_optimist_sbt_approve() (gas: 97
490
)
OptimistTest:test_optimist_sbt_transfer() (gas: 102
537
)
OptimistTest:test_optimist_set_approval_for_all() (gas: 10
1119
)
OptimistTest:test_optimist_mint_secondary_minter() (gas: 100
576
)
OptimistTest:test_optimist_sbt_approve() (gas: 97
284
)
OptimistTest:test_optimist_sbt_transfer() (gas: 102
331
)
OptimistTest:test_optimist_set_approval_for_all() (gas: 10
0907
)
OptimistTest:test_optimist_supports_interface() (gas: 5797)
OptimistTest:test_optimist_token_id_of_owner() (gas: 95
251
)
OptimistTest:test_optimist_token_uri() (gas: 21
4371
)
OptimistTest:test_optimist_token_id_of_owner() (gas: 95
045
)
OptimistTest:test_optimist_token_uri() (gas: 21
3950
)
TransactorTest:testFail_CALL() (gas: 15658)
TransactorTest:testFail_DELEGATECALLL() (gas: 15632)
TransactorTest:test_CALL() (gas: 26977)
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-periphery/contracts/foundry-tests/AttestationStation.t.sol
View file @
ef5f87e9
...
...
@@ -26,6 +26,23 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
super._setUp();
}
event AttestationCreated(
address indexed creator,
address indexed about,
bytes32 indexed key,
bytes val
);
function test_attest_individual() external {
AttestationStation attestationStation = new AttestationStation();
vm.expectEmit(true, true, true, true);
emit AttestationCreated(alice_attestor, bob, bytes32("foo"), bytes("bar"));
vm.prank(alice_attestor);
attestationStation.attest({ _about: bob, _key: bytes32("foo"), _val: bytes("bar") });
}
function test_attest_single() external {
AttestationStation attestationStation = new AttestationStation();
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-periphery/contracts/universal/op-nft/AttestationStation.sol
View file @
ef5f87e9
...
...
@@ -44,27 +44,38 @@ contract AttestationStation is Semver {
);
/**
* @custom:semver 1.
0
.0
* @custom:semver 1.
1
.0
*/
constructor() Semver(1, 0, 0) {}
constructor() Semver(1, 1, 0) {}
/**
* @notice Allows anyone to create an attestation.
*
* @param _about Address that the attestation is about.
* @param _key A key used to namespace the attestation.
* @param _val An arbitrary value stored as part of the attestation.
*/
function attest(
address _about,
bytes32 _key,
bytes memory _val
) public {
attestations[msg.sender][_about][_key] = _val;
emit AttestationCreated(msg.sender, _about, _key, _val);
}
/**
* @notice Allows anyone to create attestations.
*
* @param _attestations An array of attestation data.
*/
function attest(AttestationData[]
memory _attestations) public
{
function attest(AttestationData[]
calldata _attestations) external
{
uint256 length = _attestations.length;
for (uint256 i = 0; i < length; ) {
AttestationData memory attestation = _attestations[i];
attestations[msg.sender][attestation.about][attestation.key] = attestation.val;
emit AttestationCreated(
msg.sender,
attestation.about,
attestation.key,
attestation.val
);
attest(attestation.about, attestation.key, attestation.val);
unchecked {
++i;
...
...
This diff is collapsed.
Click to expand it.
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