diff --git a/onchain/Dockerfile b/onchain/Dockerfile index cd4d98e20..045e8ea62 100644 --- a/onchain/Dockerfile +++ b/onchain/Dockerfile @@ -1,14 +1,5 @@ -# Copyright Cartesi Pte. Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# (c) Cartesi and individual authors (see AUTHORS) +# SPDX-License-Identifier: Apache-2.0 (see LICENSE) # syntax=docker.io/docker/dockerfile:1.4 FROM node:16.17.0-alpine3.15 as base diff --git a/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplit.t.sol b/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplit.t.sol index cc367a62e..d78770bb3 100644 --- a/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplit.t.sol +++ b/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplit.t.sol @@ -1,41 +1,42 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../../src/epoch-hash-split/EpochHashSplit.sol"; import "../../src/partition/Partition.sol"; -import { Merkle } from "utils/Merkle.sol"; +import {Merkle} from "utils/Merkle.sol"; contract TestEpochHashSplit is Test { - function setUp() public { - } + function setUp() public {} function test_createSplit() public { Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(INITIAL_HASH); Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(INITIAL_HASH); Partition.Divergence memory divergence_ = createDivergence(); - divergence_.beforeHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); - - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + divergence_.beforeHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); + + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), Merkle.Hash.unwrap(preAdvanceMachine_)); - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), Merkle.Hash.unwrap(preAdvanceOutputs_)); - assertEq(waitingSubhashes_.postAdvanceEpochHashClaim, divergence_.afterHash); + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), + Merkle.Hash.unwrap(preAdvanceMachine_) + ); + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), + Merkle.Hash.unwrap(preAdvanceOutputs_) + ); + assertEq( + waitingSubhashes_.postAdvanceEpochHashClaim, + divergence_.afterHash + ); assertEq(waitingSubhashes_.inputIndex, divergence_.divergencePoint); } @@ -44,16 +45,25 @@ contract TestEpochHashSplit is Test { Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(INITIAL_HASH); Partition.Divergence memory divergence_ = createDivergence(); - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), Merkle.Hash.unwrap(preAdvanceMachine_)); - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), Merkle.Hash.unwrap(preAdvanceOutputs_)); - assertEq(waitingSubhashes_.postAdvanceEpochHashClaim, divergence_.afterHash); + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), + Merkle.Hash.unwrap(preAdvanceMachine_) + ); + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), + Merkle.Hash.unwrap(preAdvanceOutputs_) + ); + assertEq( + waitingSubhashes_.postAdvanceEpochHashClaim, + divergence_.afterHash + ); assertEq(waitingSubhashes_.inputIndex, divergence_.divergencePoint); } @@ -64,56 +74,83 @@ contract TestEpochHashSplit is Test { Merkle.Hash postAdvanceOutputsClaim_ = Merkle.Hash.wrap(INITIAL_HASH); Partition.Divergence memory divergence_ = createDivergence(); /* modify the afterHash to match the expected value */ - divergence_.beforeHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); - divergence_.afterHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); - - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + divergence_.beforeHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); + divergence_.afterHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); + + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - EpochHashSplit.supplySubhashes( + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = EpochHashSplit.supplySubhashes( waitingSubhashes_, postAdvanceMachineClaim_, postAdvanceOutputsClaim_ ); - - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine)); - assertEq(Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs)); - assertEq(Merkle.Hash.unwrap(postAdvanceMachineClaim_), Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim)); - assertEq(Merkle.Hash.unwrap(postAdvanceOutputsClaim_), Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim)); + + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine), + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine) + ); + assertEq( + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs), + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs) + ); + assertEq( + Merkle.Hash.unwrap(postAdvanceMachineClaim_), + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim) + ); + assertEq( + Merkle.Hash.unwrap(postAdvanceOutputsClaim_), + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim) + ); assertEq(waitingSubhashes_.inputIndex, waitingDivergence_.inputIndex); } function test_machineDisagree() public { - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - createWaitingDivergence(); + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = createWaitingDivergence(); - EpochHashSplit.MachineDisagree memory machineDisagree_ = - EpochHashSplit.machineDisagree( - waitingDivergence_ - ); - - assertEq(Merkle.Hash.unwrap(machineDisagree_.preAdvanceMachine), Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine)); - assertEq(Merkle.Hash.unwrap(machineDisagree_.postAdvanceMachineClaim), Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim)); + EpochHashSplit.MachineDisagree memory machineDisagree_ = EpochHashSplit + .machineDisagree(waitingDivergence_); + + assertEq( + Merkle.Hash.unwrap(machineDisagree_.preAdvanceMachine), + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine) + ); + assertEq( + Merkle.Hash.unwrap(machineDisagree_.postAdvanceMachineClaim), + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim) + ); assertEq(machineDisagree_.inputIndex, waitingDivergence_.inputIndex); } function test_outputsDisagree() public { - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - createWaitingDivergence(); - - EpochHashSplit.OutputsDisagree memory outputsDisagree_ = - EpochHashSplit.outputsDisagree( - waitingDivergence_ - ); - - assertEq(Merkle.Hash.unwrap(outputsDisagree_.preAdvanceOutputs), Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs)); - assertEq(Merkle.Hash.unwrap(outputsDisagree_.postAdvanceMachine), Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim)); - assertEq(Merkle.Hash.unwrap(outputsDisagree_.postAdvanceOutputsClaim), Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim)); + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = createWaitingDivergence(); + + EpochHashSplit.OutputsDisagree memory outputsDisagree_ = EpochHashSplit + .outputsDisagree(waitingDivergence_); + + assertEq( + Merkle.Hash.unwrap(outputsDisagree_.preAdvanceOutputs), + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs) + ); + assertEq( + Merkle.Hash.unwrap(outputsDisagree_.postAdvanceMachine), + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim) + ); + assertEq( + Merkle.Hash.unwrap(outputsDisagree_.postAdvanceOutputsClaim), + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim) + ); assertEq(outputsDisagree_.inputIndex, waitingDivergence_.inputIndex); } @@ -124,23 +161,31 @@ contract TestEpochHashSplit is Test { bytes32 constant INITIAL_HASH = 0x0000000000000000000000000000000000000000000000000000000000000000; - function createDivergence() internal pure returns (Partition.Divergence memory){ - return Partition.Divergence( - 0, - 0x0000000000000000000000000000000000000000000000000000000000000000, - 0x0000000000000000000000000000000000000000000000000000000000000001 - ); + function createDivergence() + internal + pure + returns (Partition.Divergence memory) + { + return + Partition.Divergence( + 0, + 0x0000000000000000000000000000000000000000000000000000000000000000, + 0x0000000000000000000000000000000000000000000000000000000000000001 + ); } - function createWaitingDivergence() internal pure returns(EpochHashSplit.WaitingDivergence memory){ - return EpochHashSplit.WaitingDivergence( - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - 0 - ); + function createWaitingDivergence() + internal + pure + returns (EpochHashSplit.WaitingDivergence memory) + { + return + EpochHashSplit.WaitingDivergence( + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + 0 + ); } } - - diff --git a/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplitEnum.t.sol b/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplitEnum.t.sol index dac7e4457..88b291a6c 100644 --- a/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplitEnum.t.sol +++ b/onchain/rollups-arbitration/test/epoch-hash-split/EpochHashSplitEnum.t.sol @@ -1,41 +1,32 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../../src/epoch-hash-split/EpochHashSplit.sol"; import "../../src/epoch-hash-split/EpochHashSplitEnum.sol"; import "../../src/partition/Partition.sol"; -import { Merkle } from "utils/Merkle.sol"; - +import {Merkle} from "utils/Merkle.sol"; contract TestEpochHashSplitEnum is Test { - function setUp() public { - } + function setUp() public {} function test_enumOfWaitingSubhashes() public { Partition.Divergence memory divergence_ = createDivergence(); Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(INITIAL_HASH); Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(INITIAL_HASH); - divergence_.beforeHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); + divergence_.beforeHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplitEnum.T memory enumWaitingSubhashes_ = - EpochHashSplitEnum.enumOfWaitingSubhashes(waitingSubhashes_); + EpochHashSplitEnum.T memory enumWaitingSubhashes_ = EpochHashSplitEnum + .enumOfWaitingSubhashes(waitingSubhashes_); assertTrue( EpochHashSplitEnum.isWaitingSubhashesVariant(enumWaitingSubhashes_) @@ -43,23 +34,25 @@ contract TestEpochHashSplitEnum is Test { } function test_enumOfWaitingDivergence() public { - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - createWaitingDivergence(); + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = createWaitingDivergence(); - EpochHashSplitEnum.T memory enumWaitingDivergence_ = - EpochHashSplitEnum.enumOfWaitingDivergence(waitingDivergence_); + EpochHashSplitEnum.T memory enumWaitingDivergence_ = EpochHashSplitEnum + .enumOfWaitingDivergence(waitingDivergence_); assertTrue( - EpochHashSplitEnum.isWaitingDivergenceVariant(enumWaitingDivergence_) - ); + EpochHashSplitEnum.isWaitingDivergenceVariant( + enumWaitingDivergence_ + ) + ); } function testFail_isWaitingSubhashesVariant() public { - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - createWaitingDivergence(); + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = createWaitingDivergence(); - EpochHashSplitEnum.T memory enumWaitingDivergence_ = - EpochHashSplitEnum.enumOfWaitingDivergence(waitingDivergence_); + EpochHashSplitEnum.T memory enumWaitingDivergence_ = EpochHashSplitEnum + .enumOfWaitingDivergence(waitingDivergence_); assertTrue( EpochHashSplitEnum.isWaitingSubhashesVariant(enumWaitingDivergence_) @@ -70,85 +63,102 @@ contract TestEpochHashSplitEnum is Test { Partition.Divergence memory divergence_ = createDivergence(); Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(INITIAL_HASH); Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(INITIAL_HASH); - divergence_.beforeHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); + divergence_.beforeHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplitEnum.T memory enumWaitingSubhashes_ = - EpochHashSplitEnum.enumOfWaitingSubhashes(waitingSubhashes_); - + EpochHashSplitEnum.T memory enumWaitingSubhashes_ = EpochHashSplitEnum + .enumOfWaitingSubhashes(waitingSubhashes_); + assertTrue( EpochHashSplitEnum.isWaitingDivergenceVariant(enumWaitingSubhashes_) - ); + ); } function test_getWaitingSubhashesVariant() public { Partition.Divergence memory divergence_ = createDivergence(); Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(INITIAL_HASH); Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(INITIAL_HASH); - divergence_.beforeHash = bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); + divergence_.beforeHash = bytes32( + 0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + ); - EpochHashSplit.WaitingSubhashes memory waitingSubhashes_ = - EpochHashSplit.createSplit( + EpochHashSplit.WaitingSubhashes + memory waitingSubhashes_ = EpochHashSplit.createSplit( divergence_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplitEnum.T memory enumWaitingSubhashes_ = - EpochHashSplitEnum.enumOfWaitingSubhashes(waitingSubhashes_); - EpochHashSplit.WaitingSubhashes memory recoveredWaitingSubhashes_ = - EpochHashSplitEnum.getWaitingSubhashesVariant(enumWaitingSubhashes_); + EpochHashSplitEnum.T memory enumWaitingSubhashes_ = EpochHashSplitEnum + .enumOfWaitingSubhashes(waitingSubhashes_); + EpochHashSplit.WaitingSubhashes + memory recoveredWaitingSubhashes_ = EpochHashSplitEnum + .getWaitingSubhashesVariant(enumWaitingSubhashes_); assertTrue( - Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine) == - Merkle.Hash.unwrap(recoveredWaitingSubhashes_.preAdvanceMachine) + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceMachine) == + Merkle.Hash.unwrap(recoveredWaitingSubhashes_.preAdvanceMachine) ); assertTrue( - Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs) == - Merkle.Hash.unwrap(recoveredWaitingSubhashes_.preAdvanceOutputs) + Merkle.Hash.unwrap(waitingSubhashes_.preAdvanceOutputs) == + Merkle.Hash.unwrap(recoveredWaitingSubhashes_.preAdvanceOutputs) ); assertTrue( - waitingSubhashes_.postAdvanceEpochHashClaim == - recoveredWaitingSubhashes_.postAdvanceEpochHashClaim + waitingSubhashes_.postAdvanceEpochHashClaim == + recoveredWaitingSubhashes_.postAdvanceEpochHashClaim ); assertTrue( - waitingSubhashes_.inputIndex == recoveredWaitingSubhashes_.inputIndex + waitingSubhashes_.inputIndex == + recoveredWaitingSubhashes_.inputIndex ); } function test_getWaitingDivergenceVariant() public { - EpochHashSplit.WaitingDivergence memory waitingDivergence_ = - createWaitingDivergence(); - - EpochHashSplitEnum.T memory enumWaitingDivergence_ = - EpochHashSplitEnum.enumOfWaitingDivergence(waitingDivergence_); - EpochHashSplit.WaitingDivergence memory recoveredWaitingDivergence_ = - EpochHashSplitEnum.getWaitingDivergenceVariant(enumWaitingDivergence_); - + EpochHashSplit.WaitingDivergence + memory waitingDivergence_ = createWaitingDivergence(); + + EpochHashSplitEnum.T memory enumWaitingDivergence_ = EpochHashSplitEnum + .enumOfWaitingDivergence(waitingDivergence_); + EpochHashSplit.WaitingDivergence + memory recoveredWaitingDivergence_ = EpochHashSplitEnum + .getWaitingDivergenceVariant(enumWaitingDivergence_); + assertTrue( - Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine) == - Merkle.Hash.unwrap(recoveredWaitingDivergence_.preAdvanceMachine) + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceMachine) == + Merkle.Hash.unwrap( + recoveredWaitingDivergence_.preAdvanceMachine + ) ); assertTrue( - Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs) == - Merkle.Hash.unwrap(recoveredWaitingDivergence_.preAdvanceOutputs) + Merkle.Hash.unwrap(waitingDivergence_.preAdvanceOutputs) == + Merkle.Hash.unwrap( + recoveredWaitingDivergence_.preAdvanceOutputs + ) ); assertTrue( - Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim) == - Merkle.Hash.unwrap(recoveredWaitingDivergence_.postAdvanceMachineClaim) + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceMachineClaim) == + Merkle.Hash.unwrap( + recoveredWaitingDivergence_.postAdvanceMachineClaim + ) ); assertTrue( - Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim) == - Merkle.Hash.unwrap(recoveredWaitingDivergence_.postAdvanceOutputsClaim) + Merkle.Hash.unwrap(waitingDivergence_.postAdvanceOutputsClaim) == + Merkle.Hash.unwrap( + recoveredWaitingDivergence_.postAdvanceOutputsClaim + ) + ); + assertTrue( + waitingDivergence_.inputIndex == + recoveredWaitingDivergence_.inputIndex ); - assertTrue(waitingDivergence_.inputIndex == recoveredWaitingDivergence_.inputIndex); } - /* Internal helper methods */ @@ -156,22 +166,31 @@ contract TestEpochHashSplitEnum is Test { bytes32 constant INITIAL_HASH = 0x0000000000000000000000000000000000000000000000000000000000000000; - function createDivergence() internal pure returns (Partition.Divergence memory){ - return Partition.Divergence( - 0, - 0x0000000000000000000000000000000000000000000000000000000000000000, - 0x0000000000000000000000000000000000000000000000000000000000000001 - ); + function createDivergence() + internal + pure + returns (Partition.Divergence memory) + { + return + Partition.Divergence( + 0, + 0x0000000000000000000000000000000000000000000000000000000000000000, + 0x0000000000000000000000000000000000000000000000000000000000000001 + ); } - function createWaitingDivergence() internal pure returns(EpochHashSplit.WaitingDivergence memory){ - return EpochHashSplit.WaitingDivergence( - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - Merkle.Hash.wrap(INITIAL_HASH), - 0 - ); + function createWaitingDivergence() + internal + pure + returns (EpochHashSplit.WaitingDivergence memory) + { + return + EpochHashSplit.WaitingDivergence( + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + Merkle.Hash.wrap(INITIAL_HASH), + 0 + ); } - -} \ No newline at end of file +} diff --git a/onchain/rollups-arbitration/test/partition/Partition.t.sol b/onchain/rollups-arbitration/test/partition/Partition.t.sol index 244b25dcc..329cad1f6 100644 --- a/onchain/rollups-arbitration/test/partition/Partition.t.sol +++ b/onchain/rollups-arbitration/test/partition/Partition.t.sol @@ -1,21 +1,11 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../../src/partition/Partition.sol"; contract TestPartition is Test { - function setUp() public {} // @@ -23,13 +13,12 @@ contract TestPartition is Test { // function test_createPartition() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 2, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + 2, + INITIAL_HASH, + CLAIMER_FINAL_HASH + ); assertEq(waitingHash.agreePoint, 0); assertEq(waitingHash.disagreePoint, 2); @@ -38,43 +27,27 @@ contract TestPartition is Test { } function testFail_createPartition1() public pure { - Partition.createPartition( - 1, - 0, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.createPartition(1, 0, INITIAL_HASH, CLAIMER_FINAL_HASH); } function testFail_createPartition2() public pure { - Partition.createPartition( - 1, - 1, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.createPartition(1, 1, INITIAL_HASH, CLAIMER_FINAL_HASH); } function testFail_createPartition3() public pure { - Partition.createPartition( + Partition.createPartition(0, 1, INITIAL_HASH, CLAIMER_FINAL_HASH); + } + + function test_supplyIntermediateHash() public { + Partition.WaitingHash memory waitingHash = Partition.createPartition( 0, - 1, + 4, INITIAL_HASH, CLAIMER_FINAL_HASH ); - } - - function test_supplyIntermediateHash() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 4, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); - Partition.WaitingInterval memory waitingInterval = - Partition.WaitingInterval(waitingHash, INTERMEDIATE_HASH); + Partition.WaitingInterval memory waitingInterval = Partition + .WaitingInterval(waitingHash, INTERMEDIATE_HASH); assertEq(waitingInterval.waitingHash.agreePoint, 0); assertEq(waitingInterval.waitingHash.disagreePoint, 4); @@ -84,19 +57,18 @@ contract TestPartition is Test { } function test_supplyDivergenceIntervalAgree() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 4, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + 4, + INITIAL_HASH, + CLAIMER_FINAL_HASH + ); - Partition.WaitingInterval memory waitingInterval = - Partition.supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); + Partition.WaitingInterval memory waitingInterval = Partition + .supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); - Partition.WaitingHash memory nextWaitingHash = - Partition.supplyDivergenceInterval(waitingInterval, true); + Partition.WaitingHash memory nextWaitingHash = Partition + .supplyDivergenceInterval(waitingInterval, true); assertEq(2, nextWaitingHash.agreePoint); assertEq(4, nextWaitingHash.disagreePoint); @@ -105,19 +77,18 @@ contract TestPartition is Test { } function test_supplyDivergenceIntervalDisagree() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 4, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + 4, + INITIAL_HASH, + CLAIMER_FINAL_HASH + ); - Partition.WaitingInterval memory waitingInterval = - Partition.supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); + Partition.WaitingInterval memory waitingInterval = Partition + .supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); - Partition.WaitingHash memory nextWaitingHash = - Partition.supplyDivergenceInterval(waitingInterval, false); + Partition.WaitingHash memory nextWaitingHash = Partition + .supplyDivergenceInterval(waitingInterval, false); assertEq(0, nextWaitingHash.agreePoint); assertEq(2, nextWaitingHash.disagreePoint); @@ -126,19 +97,20 @@ contract TestPartition is Test { } function test_endPartitionAgree() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 2, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + 2, + INITIAL_HASH, + CLAIMER_FINAL_HASH + ); - Partition.WaitingInterval memory waitingInterval = - Partition.supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); + Partition.WaitingInterval memory waitingInterval = Partition + .supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); - Partition.Divergence memory d = - Partition.endPartition(waitingInterval, true); + Partition.Divergence memory d = Partition.endPartition( + waitingInterval, + true + ); assertEq(1, d.divergencePoint); assertEq(INTERMEDIATE_HASH, d.beforeHash); @@ -146,27 +118,26 @@ contract TestPartition is Test { } function test_endPartitionDisagree() public { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - 2, - INITIAL_HASH, - CLAIMER_FINAL_HASH - ); - - Partition.WaitingInterval memory waitingInterval = - Partition.supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + 2, + INITIAL_HASH, + CLAIMER_FINAL_HASH + ); - Partition.Divergence memory d = - Partition.endPartition(waitingInterval, false); + Partition.WaitingInterval memory waitingInterval = Partition + .supplyIntermediateHash(waitingHash, INTERMEDIATE_HASH); + Partition.Divergence memory d = Partition.endPartition( + waitingInterval, + false + ); assertEq(0, d.divergencePoint); assertEq(INITIAL_HASH, d.beforeHash); assertEq(INTERMEDIATE_HASH, d.afterHash); } - // // Partition proofs // @@ -224,19 +195,18 @@ contract TestPartition is Test { return; } - Partition.WaitingHash memory waitingHash = - Partition.WaitingHash( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + Partition.WaitingHash memory waitingHash = Partition.WaitingHash( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); assertTrue( - Partition.mustEndPartition(waitingHash) && - !Partition.mustContinuePartition(waitingHash) || - !Partition.mustEndPartition(waitingHash) && - Partition.mustContinuePartition(waitingHash) + (Partition.mustEndPartition(waitingHash) && + !Partition.mustContinuePartition(waitingHash)) || + (!Partition.mustEndPartition(waitingHash) && + Partition.mustContinuePartition(waitingHash)) ); } @@ -252,20 +222,19 @@ contract TestPartition is Test { return; } - Partition.WaitingHash memory waitingHash = - Partition.WaitingHash( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + Partition.WaitingHash memory waitingHash = Partition.WaitingHash( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); if (Partition.mustEndPartition(waitingHash)) { return; } - Partition.WaitingInterval memory waitingInterval = - Partition.supplyIntermediateHash(waitingHash, intermediateHash); + Partition.WaitingInterval memory waitingInterval = Partition + .supplyIntermediateHash(waitingHash, intermediateHash); Partition.WaitingHash memory w = waitingInterval.waitingHash; compareWaitingHash(waitingHash, w); @@ -273,15 +242,17 @@ contract TestPartition is Test { if (agreeProxy == 0) { if (w.agreePoint + 2 == w.disagreePoint) { - Partition.Divergence memory d = - Partition.endPartition(waitingInterval, true); + Partition.Divergence memory d = Partition.endPartition( + waitingInterval, + true + ); assertEq(d.divergencePoint, w.agreePoint + 1); assertEq(d.beforeHash, intermediateHash); assertEq(d.afterHash, claimerFinalHash); } else { - Partition.WaitingHash memory nextWaitingHash = - Partition.supplyDivergenceInterval(waitingInterval, true); + Partition.WaitingHash memory nextWaitingHash = Partition + .supplyDivergenceInterval(waitingInterval, true); assertEq( Arithmetic.semiSum(initialPoint, finalPoint), @@ -292,17 +263,21 @@ contract TestPartition is Test { assertEq(claimerFinalHash, nextWaitingHash.disagreeHash); } } else { - if (w.agreePoint + 2 == w.disagreePoint || - w.agreePoint + 3 == w.disagreePoint) { - Partition.Divergence memory d = - Partition.endPartition(waitingInterval, false); + if ( + w.agreePoint + 2 == w.disagreePoint || + w.agreePoint + 3 == w.disagreePoint + ) { + Partition.Divergence memory d = Partition.endPartition( + waitingInterval, + false + ); assertEq(d.divergencePoint, w.agreePoint); assertEq(d.beforeHash, initialHash); assertEq(d.afterHash, intermediateHash); } else { - Partition.WaitingHash memory nextWaitingHash = - Partition.supplyDivergenceInterval(waitingInterval, false); + Partition.WaitingHash memory nextWaitingHash = Partition + .supplyDivergenceInterval(waitingInterval, false); assertEq(w.agreePoint, nextWaitingHash.agreePoint); assertEq( @@ -315,15 +290,14 @@ contract TestPartition is Test { } } - // // SemiSum tests // - function test_semiSum() public{ + function test_semiSum() public { assertEq(0, Arithmetic.semiSum(0, 0)); assertEq(0, Arithmetic.semiSum(0, 1)); - assertEq(1, Arithmetic.semiSum(0, 2 )); + assertEq(1, Arithmetic.semiSum(0, 2)); assertEq(1, Arithmetic.semiSum(0, 3)); assertEq(2, Arithmetic.semiSum(0, 4)); assertEq(15, Arithmetic.semiSum(10, 20)); @@ -351,7 +325,6 @@ contract TestPartition is Test { Arithmetic.semiSum(a, b); } - // // Internal helper methods // @@ -366,9 +339,7 @@ contract TestPartition is Test { function compareWaitingHash( Partition.WaitingHash memory w1, Partition.WaitingHash memory w2 - ) - internal - { + ) internal { assertEq(w1.agreePoint, w2.agreePoint); assertEq(w1.disagreePoint, w2.disagreePoint); assertEq(w1.agreeHash, w2.agreeHash); diff --git a/onchain/rollups-arbitration/test/partition/PartitionEnum.t.sol b/onchain/rollups-arbitration/test/partition/PartitionEnum.t.sol index e023e1579..2bc332610 100644 --- a/onchain/rollups-arbitration/test/partition/PartitionEnum.t.sol +++ b/onchain/rollups-arbitration/test/partition/PartitionEnum.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; @@ -16,7 +7,6 @@ import "../../src/partition/PartitionEnum.sol"; import "../../src/partition/Partition.sol"; contract TestPartitionEnum is Test { - function setUp() public {} // @@ -27,11 +17,12 @@ contract TestPartitionEnum is Test { Partition.WaitingHash memory waitingHash = createWaitingHash(); PartitionEnum.T memory enumWaitingHash = PartitionEnum.T( - PartitionEnum.Tag.WaitingHash, abi.encode(waitingHash) + PartitionEnum.Tag.WaitingHash, + abi.encode(waitingHash) ); - PartitionEnum.T memory newEnumWaitingHash = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory newEnumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); compareWaitingHashEnum(enumWaitingHash, newEnumWaitingHash); } @@ -40,39 +31,42 @@ contract TestPartitionEnum is Test { Partition.WaitingHash memory waitingHash = createWaitingHash(); PartitionEnum.T memory enumWaitingHash = PartitionEnum.T( - PartitionEnum.Tag.WaitingInterval, abi.encode(waitingHash) + PartitionEnum.Tag.WaitingInterval, + abi.encode(waitingHash) ); - PartitionEnum.T memory newEnumWaitingHash = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory newEnumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); compareWaitingHashEnum(enumWaitingHash, newEnumWaitingHash); } function test_enumOfWaitingInterval() public { - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval(); + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval(); PartitionEnum.T memory enumWaitingInterval = PartitionEnum.T( - PartitionEnum.Tag.WaitingInterval, abi.encode(waitingInterval) + PartitionEnum.Tag.WaitingInterval, + abi.encode(waitingInterval) ); - PartitionEnum.T memory newEnumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory newEnumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); compareWaitingIntervalEnum(enumWaitingInterval, newEnumWaitingInterval); } function testFail_enumOfWaitingInterval() public { - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval(); + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval(); PartitionEnum.T memory enumWaitingInterval = PartitionEnum.T( - PartitionEnum.Tag.WaitingHash, abi.encode(waitingInterval) + PartitionEnum.Tag.WaitingHash, + abi.encode(waitingInterval) ); - PartitionEnum.T memory newEnumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory newEnumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); compareWaitingIntervalEnum(enumWaitingInterval, newEnumWaitingInterval); } @@ -80,45 +74,47 @@ contract TestPartitionEnum is Test { function test_getWaitingHashVariant() public { Partition.WaitingHash memory waitingHash = createWaitingHash(); - PartitionEnum.T memory enumWaitingHash = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory enumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); assertTrue(enumWaitingHash._tag == PartitionEnum.Tag.WaitingHash); - Partition.WaitingHash memory newWaitingHash = - PartitionEnum.getWaitingHashVariant(enumWaitingHash); + Partition.WaitingHash memory newWaitingHash = PartitionEnum + .getWaitingHashVariant(enumWaitingHash); compareWaitingHash(waitingHash, newWaitingHash); } - function testFail_getWaitingHashVariant() pure public { - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval(); + function testFail_getWaitingHashVariant() public pure { + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval(); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); PartitionEnum.getWaitingHashVariant(enumWaitingInterval); } function test_getWaitingIntervalVariant() public { - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval(); + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval(); - PartitionEnum.T memory enumT = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory enumT = PartitionEnum.enumOfWaitingInterval( + waitingInterval + ); assertTrue(enumT._tag == PartitionEnum.Tag.WaitingInterval); - Partition.WaitingInterval memory newWaitingInterval = - PartitionEnum.getWaitingIntervalVariant(enumT); + Partition.WaitingInterval memory newWaitingInterval = PartitionEnum + .getWaitingIntervalVariant(enumT); compareWaitingInterval(waitingInterval, newWaitingInterval); } - function testFail_getWaitingIntervalVariant() pure public { + function testFail_getWaitingIntervalVariant() public pure { Partition.WaitingHash memory waitingHash = createWaitingHash(); - PartitionEnum.T memory enumWaitingHash = PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory enumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); PartitionEnum.getWaitingIntervalVariant(enumWaitingHash); } @@ -133,21 +129,20 @@ contract TestPartitionEnum is Test { bytes32 initialHash, bytes32 claimerFinalHash ) public { - Partition.WaitingHash memory waitingHash = - Partition.WaitingHash( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + Partition.WaitingHash memory waitingHash = Partition.WaitingHash( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); - PartitionEnum.T memory enumWaitingHash = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory enumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); assertTrue(PartitionEnum.isWaitingHashVariant(enumWaitingHash)); assertTrue(!PartitionEnum.isWaitingIntervalVariant(enumWaitingHash)); - Partition.WaitingHash memory newWaitingHash = - PartitionEnum.getWaitingHashVariant(enumWaitingHash); + Partition.WaitingHash memory newWaitingHash = PartitionEnum + .getWaitingHashVariant(enumWaitingHash); compareWaitingHash(waitingHash, newWaitingHash); } @@ -158,16 +153,15 @@ contract TestPartitionEnum is Test { bytes32 initialHash, bytes32 claimerFinalHash ) public pure { - Partition.WaitingHash memory waitingHash = - Partition.WaitingHash( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + Partition.WaitingHash memory waitingHash = Partition.WaitingHash( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); - PartitionEnum.T memory enumWaitingHash = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory enumWaitingHash = PartitionEnum + .enumOfWaitingHash(waitingHash); PartitionEnum.getWaitingIntervalVariant(enumWaitingHash); } @@ -179,8 +173,8 @@ contract TestPartitionEnum is Test { bytes32 claimerFinalHash, bytes32 intermediateHash ) public { - Partition.WaitingInterval memory waitingInterval = - Partition.WaitingInterval( + Partition.WaitingInterval memory waitingInterval = Partition + .WaitingInterval( Partition.WaitingHash( initialPoint, finalPoint, @@ -190,13 +184,13 @@ contract TestPartitionEnum is Test { intermediateHash ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); assertTrue(PartitionEnum.isWaitingIntervalVariant(enumWaitingInterval)); assertTrue(!PartitionEnum.isWaitingHashVariant(enumWaitingInterval)); - Partition.WaitingInterval memory newWaitingInterval = - PartitionEnum.getWaitingIntervalVariant(enumWaitingInterval); + Partition.WaitingInterval memory newWaitingInterval = PartitionEnum + .getWaitingIntervalVariant(enumWaitingInterval); compareWaitingInterval(waitingInterval, newWaitingInterval); } @@ -208,8 +202,8 @@ contract TestPartitionEnum is Test { bytes32 claimerFinalHash, bytes32 intermediateHash ) public pure { - Partition.WaitingInterval memory waitingInterval = - Partition.WaitingInterval( + Partition.WaitingInterval memory waitingInterval = Partition + .WaitingInterval( Partition.WaitingHash( initialPoint, finalPoint, @@ -219,13 +213,12 @@ contract TestPartitionEnum is Test { intermediateHash ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); PartitionEnum.getWaitingHashVariant(enumWaitingInterval); } - // // Internal helper methods // @@ -242,20 +235,19 @@ contract TestPartitionEnum is Test { function createWaitingHash() internal pure - returns(Partition.WaitingHash memory) + returns (Partition.WaitingHash memory) { uint64 initialPoint = 1; uint64 finalPoint = 4; bytes32 initialHash = INITIAL_HASH; bytes32 claimerFinalHash = CLAIMER_FINAL_HASH; - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + Partition.WaitingHash memory waitingHash = Partition.createPartition( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); return waitingHash; } @@ -263,16 +255,13 @@ contract TestPartitionEnum is Test { function createWaitingInterval() internal pure - returns(Partition.WaitingInterval memory) + returns (Partition.WaitingInterval memory) { bytes32 intermediateHash = INTERMEDIATE_HASH; Partition.WaitingHash memory waitingHash = createWaitingHash(); - Partition.WaitingInterval memory waitingInterval = - Partition.WaitingInterval( - waitingHash, - intermediateHash - ); + Partition.WaitingInterval memory waitingInterval = Partition + .WaitingInterval(waitingHash, intermediateHash); return waitingInterval; } @@ -280,9 +269,7 @@ contract TestPartitionEnum is Test { function compareWaitingHash( Partition.WaitingHash memory w1, Partition.WaitingHash memory w2 - ) - internal - { + ) internal { assertEq(w1.agreePoint, w2.agreePoint); assertEq(w1.disagreePoint, w2.disagreePoint); assertEq(w1.agreeHash, w2.agreeHash); @@ -292,9 +279,7 @@ contract TestPartitionEnum is Test { function compareWaitingInterval( Partition.WaitingInterval memory w1, Partition.WaitingInterval memory w2 - ) - internal - { + ) internal { assertEq(w1.intermediateHash, w2.intermediateHash); compareWaitingHash(w1.waitingHash, w2.waitingHash); } @@ -302,16 +287,16 @@ contract TestPartitionEnum is Test { function compareWaitingHashEnum( PartitionEnum.T memory ew1, PartitionEnum.T memory ew2 - ) - internal - { + ) internal { assertTrue(ew1._tag == ew2._tag); - Partition.WaitingHash memory w1 = - PartitionEnum.getWaitingHashVariant(ew1); + Partition.WaitingHash memory w1 = PartitionEnum.getWaitingHashVariant( + ew1 + ); - Partition.WaitingHash memory w2 = - PartitionEnum.getWaitingHashVariant(ew2); + Partition.WaitingHash memory w2 = PartitionEnum.getWaitingHashVariant( + ew2 + ); compareWaitingHash(w1, w2); } @@ -319,16 +304,14 @@ contract TestPartitionEnum is Test { function compareWaitingIntervalEnum( PartitionEnum.T memory ew1, PartitionEnum.T memory ew2 - ) - internal - { + ) internal { assertTrue(ew1._tag == ew2._tag); - Partition.WaitingInterval memory w1 = - PartitionEnum.getWaitingIntervalVariant(ew1); + Partition.WaitingInterval memory w1 = PartitionEnum + .getWaitingIntervalVariant(ew1); - Partition.WaitingInterval memory w2 = - PartitionEnum.getWaitingIntervalVariant(ew2); + Partition.WaitingInterval memory w2 = PartitionEnum + .getWaitingIntervalVariant(ew2); compareWaitingInterval(w1, w2); } diff --git a/onchain/rollups-arbitration/test/splice/SpliceMachine.t.sol b/onchain/rollups-arbitration/test/splice/SpliceMachine.t.sol index ad2df94ed..783ed442a 100644 --- a/onchain/rollups-arbitration/test/splice/SpliceMachine.t.sol +++ b/onchain/rollups-arbitration/test/splice/SpliceMachine.t.sol @@ -1,103 +1,105 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../../src/splice/SpliceMachine.sol"; contract TestSpliceMachine is Test { - - function setUp() public { - } + function setUp() public {} function test_createSplice() public { - EpochHashSplit.MachineDisagree memory machineDisagree_ = - EpochHashSplit.MachineDisagree( + EpochHashSplit.MachineDisagree memory machineDisagree_ = EpochHashSplit + .MachineDisagree( Merkle.Hash.wrap(INITIAL_HASH), Merkle.Hash.wrap(INITIAL_HASH), 0 ); - - SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = - SpliceMachine.createSplice(machineDisagree_, 0); - + + SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = SpliceMachine + .createSplice(machineDisagree_, 0); + assertTrue( - waitingSplice_.machineDisagree.inputIndex == machineDisagree_.inputIndex + waitingSplice_.machineDisagree.inputIndex == + machineDisagree_.inputIndex ); assertTrue( - Merkle.Hash.unwrap(waitingSplice_.machineDisagree.preAdvanceMachine) == - Merkle.Hash.unwrap(machineDisagree_.preAdvanceMachine) + Merkle.Hash.unwrap( + waitingSplice_.machineDisagree.preAdvanceMachine + ) == Merkle.Hash.unwrap(machineDisagree_.preAdvanceMachine) ); assertTrue( - Merkle.Hash.unwrap(waitingSplice_.machineDisagree.postAdvanceMachineClaim) == - Merkle.Hash.unwrap(machineDisagree_.postAdvanceMachineClaim) + Merkle.Hash.unwrap( + waitingSplice_.machineDisagree.postAdvanceMachineClaim + ) == Merkle.Hash.unwrap(machineDisagree_.postAdvanceMachineClaim) ); } function test_spliceSupplyHash() public { - SpliceMachine.WaitingAgreement memory waitingAgree_ = - createWaitingAgreement(); + SpliceMachine.WaitingAgreement + memory waitingAgree_ = createWaitingAgreement(); + assertTrue(waitingAgree_.preSpliceData.machineDisagree.inputIndex == 0); assertTrue( - waitingAgree_.preSpliceData.machineDisagree.inputIndex == - 0 - ); - assertTrue( - Merkle.Hash.unwrap(waitingAgree_.preSpliceData.machineDisagree.preAdvanceMachine) == - INITIAL_HASH + Merkle.Hash.unwrap( + waitingAgree_.preSpliceData.machineDisagree.preAdvanceMachine + ) == INITIAL_HASH ); assertTrue( - Merkle.Hash.unwrap(waitingAgree_.preSpliceData.machineDisagree.postAdvanceMachineClaim) == - INITIAL_HASH + Merkle.Hash.unwrap( + waitingAgree_ + .preSpliceData + .machineDisagree + .postAdvanceMachineClaim + ) == INITIAL_HASH ); } function test_spliceAcceptClaim() public { - SpliceMachine.WaitingAgreement memory waitingAgree_ = - createWaitingAgreement(); - - SpliceMachine.SpliceAgree memory spliceAgree_ = - SpliceMachine.spliceAcceptClaim(waitingAgree_); - + SpliceMachine.WaitingAgreement + memory waitingAgree_ = createWaitingAgreement(); + + SpliceMachine.SpliceAgree memory spliceAgree_ = SpliceMachine + .spliceAcceptClaim(waitingAgree_); + assertTrue( - Merkle.Hash.unwrap(spliceAgree_.postSpliceMachineHashClaim) == - Merkle.Hash.unwrap(waitingAgree_.postSpliceMachineHashClaim) + Merkle.Hash.unwrap(spliceAgree_.postSpliceMachineHashClaim) == + Merkle.Hash.unwrap(waitingAgree_.postSpliceMachineHashClaim) ); assertTrue( - Merkle.Hash.unwrap(spliceAgree_.postAdvanceMachineClaim) == - Merkle.Hash.unwrap(waitingAgree_.preSpliceData.machineDisagree.postAdvanceMachineClaim) + Merkle.Hash.unwrap(spliceAgree_.postAdvanceMachineClaim) == + Merkle.Hash.unwrap( + waitingAgree_ + .preSpliceData + .machineDisagree + .postAdvanceMachineClaim + ) ); - } + /* Internal helper methods */ bytes32 constant INITIAL_HASH = 0x0000000000000000000000000000000000000000000000000000000000000000; - - function createWaitingAgreement() public pure returns (SpliceMachine.WaitingAgreement memory) { - EpochHashSplit.MachineDisagree memory machineDisagree_ = - EpochHashSplit.MachineDisagree( + + function createWaitingAgreement() + public + pure + returns (SpliceMachine.WaitingAgreement memory) + { + EpochHashSplit.MachineDisagree memory machineDisagree_ = EpochHashSplit + .MachineDisagree( Merkle.Hash.wrap(INITIAL_HASH), Merkle.Hash.wrap(INITIAL_HASH), 0 ); - SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = - SpliceMachine.createSplice(machineDisagree_, 0); + SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = SpliceMachine + .createSplice(machineDisagree_, 0); Merkle.Hash postSpliceMachineHash_ = Merkle.Hash.wrap(INITIAL_HASH); - SpliceMachine.WaitingAgreement memory waitingAgree_ = - SpliceMachine.spliceSupplyHash(waitingSplice_, postSpliceMachineHash_); + SpliceMachine.WaitingAgreement memory waitingAgree_ = SpliceMachine + .spliceSupplyHash(waitingSplice_, postSpliceMachineHash_); return waitingAgree_; } - -} \ No newline at end of file +} diff --git a/onchain/rollups-arbitration/test/splice/SpliceMachineEnum.t.sol b/onchain/rollups-arbitration/test/splice/SpliceMachineEnum.t.sol index 6fd9c48eb..0ba491cf7 100644 --- a/onchain/rollups-arbitration/test/splice/SpliceMachineEnum.t.sol +++ b/onchain/rollups-arbitration/test/splice/SpliceMachineEnum.t.sol @@ -1,80 +1,81 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../../src/splice/SpliceMachine.sol"; import "../../src/splice/SpliceMachineEnum.sol"; -import { Merkle } from "utils/Merkle.sol"; - +import {Merkle} from "utils/Merkle.sol"; contract TestSpliceMachineEnum is Test { - - function setUp() public { - } + function setUp() public {} // // `WaitingSpliceClaim` methods // function test_enumOfWaitingSpliceClaim() public { - SpliceMachine.WaitingSpliceClaim memory waitingSpliceClaim = - createWaitingSplice(); + SpliceMachine.WaitingSpliceClaim + memory waitingSpliceClaim = createWaitingSplice(); + + SpliceMachineEnum.T memory enumWaitingSpliceClaim = SpliceMachineEnum + .enumOfWaitingSpliceClaim(waitingSpliceClaim); - SpliceMachineEnum.T memory enumWaitingSpliceClaim = - SpliceMachineEnum.enumOfWaitingSpliceClaim(waitingSpliceClaim); - assertTrue( - SpliceMachineEnum.isWaitingSpliceClaimVariant(enumWaitingSpliceClaim) + SpliceMachineEnum.isWaitingSpliceClaimVariant( + enumWaitingSpliceClaim + ) ); } function testFail_isWaitingSpliceClaimVariant() public { - SpliceMachine.WaitingAgreement memory waitingAgreemnt = - createWaitingAgreement(); - - SpliceMachineEnum.T memory enumWaitingAgreement = - SpliceMachineEnum.enumOfWaitingAgreement(waitingAgreemnt); - + SpliceMachine.WaitingAgreement + memory waitingAgreemnt = createWaitingAgreement(); + + SpliceMachineEnum.T memory enumWaitingAgreement = SpliceMachineEnum + .enumOfWaitingAgreement(waitingAgreemnt); + assertTrue( SpliceMachineEnum.isWaitingSpliceClaimVariant(enumWaitingAgreement) ); } function test_getWaitingSpliceClaimVariant() public { - SpliceMachine.WaitingSpliceClaim memory waitingSpliceClaim = - createWaitingSplice(); - - SpliceMachineEnum.T memory enumWaitingSpliceClaim = - SpliceMachineEnum.enumOfWaitingSpliceClaim(waitingSpliceClaim); - - SpliceMachine.WaitingSpliceClaim memory recoveredWaitingSpliceClaim = - SpliceMachineEnum.getWaitingSpliceClaimVariant(enumWaitingSpliceClaim); - + SpliceMachine.WaitingSpliceClaim + memory waitingSpliceClaim = createWaitingSplice(); + + SpliceMachineEnum.T memory enumWaitingSpliceClaim = SpliceMachineEnum + .enumOfWaitingSpliceClaim(waitingSpliceClaim); + + SpliceMachine.WaitingSpliceClaim + memory recoveredWaitingSpliceClaim = SpliceMachineEnum + .getWaitingSpliceClaimVariant(enumWaitingSpliceClaim); + assertTrue( - recoveredWaitingSpliceClaim.machineDisagree.inputIndex == - waitingSpliceClaim.machineDisagree.inputIndex + recoveredWaitingSpliceClaim.machineDisagree.inputIndex == + waitingSpliceClaim.machineDisagree.inputIndex ); assertTrue( - Merkle.Hash.unwrap(recoveredWaitingSpliceClaim.machineDisagree.preAdvanceMachine) == - Merkle.Hash.unwrap(waitingSpliceClaim.machineDisagree.preAdvanceMachine) + Merkle.Hash.unwrap( + recoveredWaitingSpliceClaim.machineDisagree.preAdvanceMachine + ) == + Merkle.Hash.unwrap( + waitingSpliceClaim.machineDisagree.preAdvanceMachine + ) ); assertTrue( - Merkle.Hash.unwrap(recoveredWaitingSpliceClaim.machineDisagree.postAdvanceMachineClaim) == - Merkle.Hash.unwrap(waitingSpliceClaim.machineDisagree.postAdvanceMachineClaim) + Merkle.Hash.unwrap( + recoveredWaitingSpliceClaim + .machineDisagree + .postAdvanceMachineClaim + ) == + Merkle.Hash.unwrap( + waitingSpliceClaim.machineDisagree.postAdvanceMachineClaim + ) ); assertTrue( - recoveredWaitingSpliceClaim.epochIndex == - waitingSpliceClaim.epochIndex + recoveredWaitingSpliceClaim.epochIndex == + waitingSpliceClaim.epochIndex ); } @@ -83,87 +84,106 @@ contract TestSpliceMachineEnum is Test { // function test_enumOfWaitingAgreement() public { - SpliceMachine.WaitingAgreement memory waitingAgreement = - createWaitingAgreement(); + SpliceMachine.WaitingAgreement + memory waitingAgreement = createWaitingAgreement(); + + SpliceMachineEnum.T memory enumWaitingAgreement = SpliceMachineEnum + .enumOfWaitingAgreement(waitingAgreement); - SpliceMachineEnum.T memory enumWaitingAgreement = - SpliceMachineEnum.enumOfWaitingAgreement(waitingAgreement); - assertTrue( SpliceMachineEnum.isWaitingAgreementVariant(enumWaitingAgreement) ); } function testFail_isWaitingAgreementVariant() public { - SpliceMachine.WaitingSpliceClaim memory waitingSpliceClaim = - createWaitingSplice(); - - SpliceMachineEnum.T memory enumWaitingSpliceClaim = - SpliceMachineEnum.enumOfWaitingSpliceClaim(waitingSpliceClaim); - + SpliceMachine.WaitingSpliceClaim + memory waitingSpliceClaim = createWaitingSplice(); + + SpliceMachineEnum.T memory enumWaitingSpliceClaim = SpliceMachineEnum + .enumOfWaitingSpliceClaim(waitingSpliceClaim); + assertTrue( SpliceMachineEnum.isWaitingAgreementVariant(enumWaitingSpliceClaim) ); } function test_getWaitingAgreementVariant() public { - SpliceMachine.WaitingAgreement memory waitingAgreement = - createWaitingAgreement(); - - SpliceMachineEnum.T memory enumWaitingAgreement = - SpliceMachineEnum.enumOfWaitingAgreement(waitingAgreement); - - SpliceMachine.WaitingAgreement memory recoveredWaitingAgreement = - SpliceMachineEnum.getWaitingAgreementVariant(enumWaitingAgreement); - + SpliceMachine.WaitingAgreement + memory waitingAgreement = createWaitingAgreement(); + + SpliceMachineEnum.T memory enumWaitingAgreement = SpliceMachineEnum + .enumOfWaitingAgreement(waitingAgreement); + + SpliceMachine.WaitingAgreement + memory recoveredWaitingAgreement = SpliceMachineEnum + .getWaitingAgreementVariant(enumWaitingAgreement); + assertTrue( - Merkle.Hash.unwrap(recoveredWaitingAgreement.postSpliceMachineHashClaim) == - Merkle.Hash.unwrap(waitingAgreement.postSpliceMachineHashClaim) + Merkle.Hash.unwrap( + recoveredWaitingAgreement.postSpliceMachineHashClaim + ) == Merkle.Hash.unwrap(waitingAgreement.postSpliceMachineHashClaim) ); assertTrue( - recoveredWaitingAgreement.preSpliceData.machineDisagree.inputIndex == - waitingAgreement.preSpliceData.machineDisagree.inputIndex + recoveredWaitingAgreement + .preSpliceData + .machineDisagree + .inputIndex == + waitingAgreement.preSpliceData.machineDisagree.inputIndex ); assertTrue( - Merkle.Hash.unwrap(recoveredWaitingAgreement.preSpliceData.machineDisagree.preAdvanceMachine) == - Merkle.Hash.unwrap(waitingAgreement.preSpliceData.machineDisagree.preAdvanceMachine) + Merkle.Hash.unwrap( + recoveredWaitingAgreement + .preSpliceData + .machineDisagree + .preAdvanceMachine + ) == + Merkle.Hash.unwrap( + waitingAgreement + .preSpliceData + .machineDisagree + .preAdvanceMachine + ) ); } - /* Internal helper methods */ bytes32 constant INITIAL_HASH = 0x0000000000000000000000000000000000000000000000000000000000000000; - - function createWaitingSplice() internal pure returns (SpliceMachine.WaitingSpliceClaim memory) { - EpochHashSplit.MachineDisagree memory machineDisagree_ = - EpochHashSplit.MachineDisagree( + + function createWaitingSplice() + internal + pure + returns (SpliceMachine.WaitingSpliceClaim memory) + { + EpochHashSplit.MachineDisagree memory machineDisagree_ = EpochHashSplit + .MachineDisagree( Merkle.Hash.wrap(INITIAL_HASH), Merkle.Hash.wrap(INITIAL_HASH), 0 ); - - return ( - SpliceMachine.createSplice(machineDisagree_, 0) - ); + + return (SpliceMachine.createSplice(machineDisagree_, 0)); } - function createWaitingAgreement() internal pure returns (SpliceMachine.WaitingAgreement memory) { - EpochHashSplit.MachineDisagree memory machineDisagree_ = - EpochHashSplit.MachineDisagree( + function createWaitingAgreement() + internal + pure + returns (SpliceMachine.WaitingAgreement memory) + { + EpochHashSplit.MachineDisagree memory machineDisagree_ = EpochHashSplit + .MachineDisagree( Merkle.Hash.wrap(INITIAL_HASH), Merkle.Hash.wrap(INITIAL_HASH), 0 ); - SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = - SpliceMachine.createSplice(machineDisagree_, 0); + SpliceMachine.WaitingSpliceClaim memory waitingSplice_ = SpliceMachine + .createSplice(machineDisagree_, 0); Merkle.Hash postSpliceMachineHash_ = Merkle.Hash.wrap(INITIAL_HASH); - SpliceMachine.WaitingAgreement memory waitingAgree_ = - SpliceMachine.spliceSupplyHash(waitingSplice_, postSpliceMachineHash_); + SpliceMachine.WaitingAgreement memory waitingAgree_ = SpliceMachine + .spliceSupplyHash(waitingSplice_, postSpliceMachineHash_); return waitingAgree_; } - -} \ No newline at end of file +} diff --git a/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitration.t.sol b/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitration.t.sol index 8fe5aa640..a519442ba 100644 --- a/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitration.t.sol +++ b/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitration.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; import "forge-std/Test.sol"; @@ -17,11 +8,9 @@ import "../../src/partition/PartitionEnum.sol"; import "../../src/splice/SpliceMachineEnum.sol"; import "../../src/two-party-arbitration/TwoPartyArbitration.sol"; import "../../src/utils/GameClockLib.sol"; -import { Merkle } from "utils/Merkle.sol"; - +import {Merkle} from "utils/Merkle.sol"; contract TestTwoPartyArbitration is Test { - function setUp() public {} /* @@ -29,41 +18,39 @@ contract TestTwoPartyArbitration is Test { */ function test_createArbitration() public { /* Init example variables */ - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); /* Context creation */ - TwoPartyArbitration.Context memory context = - createContext(args); + TwoPartyArbitration.Context memory context = createContext(args); - GameClockLib.Timer memory manual_timer = - GameClockLib.newTimerClaimerTurn( - block.timestamp, - args.timeAllowance - ); + GameClockLib.Timer memory manual_timer = GameClockLib + .newTimerClaimerTurn(block.timestamp, args.timeAllowance); + + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + args.numInputs, + args.initialHash, + args.claimedHash + ); - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - args.numInputs, - args.initialHash, - args.claimedHash - ); - /* Tagging data correctly */ - PartitionEnum.T memory waitingHashEnum = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory waitingHashEnum = PartitionEnum + .enumOfWaitingHash(waitingHash); /* After untagging input partition, the tag is still waiting hash */ - PartitionEnum.T memory unboxed_state = - TwoPartyArbitrationEnum.getInputPartitionVariant(context.state); + PartitionEnum.T memory unboxed_state = TwoPartyArbitrationEnum + .getInputPartitionVariant(context.state); compareWaitingHash(waitingHashEnum, unboxed_state); assertEq(context.arguments.challenger, PLAYER1_ADDRESS); assertEq(context.arguments.claimer, PLAYER2_ADDRESS); assertEq(context.arguments.maxCycle, 1); assertEq(context.timer.lastResume, manual_timer.lastResume); - assertEq(context.timer.challengerAllowance, manual_timer.challengerAllowance); + assertEq( + context.timer.challengerAllowance, + manual_timer.challengerAllowance + ); assertEq(context.timer.claimerAllowance, manual_timer.claimerAllowance); assertTrue(context.timer.turn == GameClockLib.Turn.Claimer); } @@ -82,49 +69,46 @@ contract TestTwoPartyArbitration is Test { SpliceDataSource dataSource_; /* Context creation */ - TwoPartyArbitration.Context memory context = - createContext( - challenger_, - claimer_, - dataSource_, - initialHash_, - claimedHash_, - epochIndex_, - numInputs_, - timeAllowance_, - maxCycle_ - ); + TwoPartyArbitration.Context memory context = createContext( + challenger_, + claimer_, + dataSource_, + initialHash_, + claimedHash_, + epochIndex_, + numInputs_, + timeAllowance_, + maxCycle_ + ); - GameClockLib.Timer memory manual_timer = - GameClockLib.newTimerClaimerTurn( - block.timestamp, - timeAllowance_ - ); + GameClockLib.Timer memory manual_timer = GameClockLib + .newTimerClaimerTurn(block.timestamp, timeAllowance_); + + Partition.WaitingHash memory waitingHash = Partition.createPartition( + 0, + numInputs_, + initialHash_, + claimedHash_ + ); - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - 0, - numInputs_, - initialHash_, - claimedHash_ - ); - /* Tagging data correctly */ - PartitionEnum.T memory waitingHashEnum = - PartitionEnum.enumOfWaitingHash(waitingHash); + PartitionEnum.T memory waitingHashEnum = PartitionEnum + .enumOfWaitingHash(waitingHash); - //After untagging input partition, the tag is still waiting hash - PartitionEnum.T memory unboxed_state = - TwoPartyArbitrationEnum.getInputPartitionVariant(context.state); + PartitionEnum.T memory unboxed_state = TwoPartyArbitrationEnum + .getInputPartitionVariant(context.state); compareWaitingHash(waitingHashEnum, unboxed_state); assertEq(context.timer.lastResume, manual_timer.lastResume); - assertEq(context.timer.challengerAllowance, manual_timer.challengerAllowance); + assertEq( + context.timer.challengerAllowance, + manual_timer.challengerAllowance + ); assertEq(context.timer.claimerAllowance, manual_timer.claimerAllowance); assertTrue(context.timer.turn == GameClockLib.Turn.Claimer); } - + /* Failing Timeout methods */ /*function testFail_challengerWinByTimeout() public view { @@ -155,30 +139,27 @@ contract TestTwoPartyArbitration is Test { TwoPartyArbitration.challengerWinByTimeout(context); }*/ - + function test_stateAdvanceSupplyIntermediateHash() public { /* Init example variables */ - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); args.claimer = msg.sender; bytes32 replyHash_ = INTERMEDIATE_HASH; /* Context creation */ - TwoPartyArbitration.Context memory context = - createContext(args); + TwoPartyArbitration.Context memory context = createContext(args); - TwoPartyArbitration.Context memory intermediateContext = - TwoPartyArbitration.stateAdvanceSupplyIntermediateHash( - context, - replyHash_ - ); + TwoPartyArbitration.Context + memory intermediateContext = TwoPartyArbitration + .stateAdvanceSupplyIntermediateHash(context, replyHash_); /* Tagging data correctly */ - PartitionEnum.T memory unboxed_state = - TwoPartyArbitrationEnum.getInputPartitionVariant(intermediateContext.state); + PartitionEnum.T memory unboxed_state = TwoPartyArbitrationEnum + .getInputPartitionVariant(intermediateContext.state); - Partition.WaitingInterval memory unboxed_partition = - PartitionEnum.getWaitingIntervalVariant(unboxed_state); + Partition.WaitingInterval memory unboxed_partition = PartitionEnum + .getWaitingIntervalVariant(unboxed_state); compareContext(intermediateContext, context); assertTrue( @@ -186,7 +167,7 @@ contract TestTwoPartyArbitration is Test { ); assertEq(unboxed_partition.intermediateHash, replyHash_); } - + function test_stateAdvanceSupplyIntermediateHashFuzzy( address challenger_, bytes32 initialHash_, @@ -202,70 +183,62 @@ contract TestTwoPartyArbitration is Test { address claimer_ = msg.sender; SpliceDataSource dataSource_; - TwoPartyArbitration.Context memory context = - createContext( - challenger_, - claimer_, - dataSource_, - initialHash_, - claimedHash_, - epochIndex_, - numInputs_, - timeAllowance_, - maxCycle_ - ); + TwoPartyArbitration.Context memory context = createContext( + challenger_, + claimer_, + dataSource_, + initialHash_, + claimedHash_, + epochIndex_, + numInputs_, + timeAllowance_, + maxCycle_ + ); - TwoPartyArbitration.Context memory intermediateContext = - TwoPartyArbitration.stateAdvanceSupplyIntermediateHash( - context, - replyHash_ - ); + TwoPartyArbitration.Context + memory intermediateContext = TwoPartyArbitration + .stateAdvanceSupplyIntermediateHash(context, replyHash_); - PartitionEnum.T memory unboxed_state = - TwoPartyArbitrationEnum.getInputPartitionVariant(intermediateContext.state); + PartitionEnum.T memory unboxed_state = TwoPartyArbitrationEnum + .getInputPartitionVariant(intermediateContext.state); - Partition.WaitingInterval memory unboxed_partition = - PartitionEnum.getWaitingIntervalVariant(unboxed_state); + Partition.WaitingInterval memory unboxed_partition = PartitionEnum + .getWaitingIntervalVariant(unboxed_state); compareContext(intermediateContext, context); assertTrue( intermediateContext.timer.turn == GameClockLib.Turn.Challenger ); assertEq(unboxed_partition.intermediateHash, replyHash_); - } - + function test_stateAdvanceSupplyDivergenceInterval() public { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); bool agree_ = false; - TwoPartyArbitration.Context memory context = - createContextofWaitingInterval( + TwoPartyArbitration.Context + memory context = createContextofWaitingInterval( args, INITIAL_POINT, FINAL_POINT ); - TwoPartyArbitration.Context memory advancedContext = - TwoPartyArbitration.stateAdvanceSupplyDivergenceInterval( - context, agree_ - ); + TwoPartyArbitration.Context memory advancedContext = TwoPartyArbitration + .stateAdvanceSupplyDivergenceInterval(context, agree_); - PartitionEnum.T memory advancedInputPartition = - TwoPartyArbitrationEnum.getInputPartitionVariant( - advancedContext.state - ); + PartitionEnum.T memory advancedInputPartition = TwoPartyArbitrationEnum + .getInputPartitionVariant(advancedContext.state); - Partition.WaitingHash memory advancedWaitingHash = - PartitionEnum.getWaitingHashVariant(advancedInputPartition); + Partition.WaitingHash memory advancedWaitingHash = PartitionEnum + .getWaitingHashVariant(advancedInputPartition); assertEq(advancedWaitingHash.agreePoint, INITIAL_POINT); assertTrue(advancedWaitingHash.disagreePoint != FINAL_POINT); assertEq(advancedWaitingHash.agreeHash, INITIAL_HASH); assertEq(advancedWaitingHash.disagreeHash, INTERMEDIATE_HASH); } - + /*function test_stateAdvanceSupplyDivergenceIntervalFuzzy( bytes32 initialHash_, bytes32 claimedHash_, @@ -314,21 +287,22 @@ contract TestTwoPartyArbitration is Test { assertEq(advancedWaitingHash.agreeHash, initialHash_); assertEq(advancedWaitingHash.disagreeHash, intermediateHash_); }*/ - - function testFail_stateAdvanceSupplyDivergenceInterval() view public { + + function testFail_stateAdvanceSupplyDivergenceInterval() public view { /* stateAdvanceSupplyDivergenceInterval will fail if the context is waitingHash type */ bool agree_ = false; - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); - TwoPartyArbitration.Context memory context = - TwoPartyArbitration.createArbitration( - args - ); + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .createArbitration(args); - TwoPartyArbitration.stateAdvanceSupplyDivergenceInterval(context, agree_); + TwoPartyArbitration.stateAdvanceSupplyDivergenceInterval( + context, + agree_ + ); } - + function test_stateAdvanceEndPartition() public { /* Is important that the divergence point for the arguments match the epoch hash, @@ -336,122 +310,138 @@ contract TestTwoPartyArbitration is Test { Also, for Semisum result we need to have the new final point to be 2,\ so we can end the partition ( 1 + (4-1)) /2 */ - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - args.initialHash = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + args.initialHash = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); uint64 finalPoint_ = 4; bool agree_ = false; - Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); + Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); - TwoPartyArbitration.Context memory context = - createContextofWaitingInterval( + TwoPartyArbitration.Context + memory context = createContextofWaitingInterval( args, INITIAL_POINT, finalPoint_ ); - TwoPartyArbitration.Context memory finalContext = - TwoPartyArbitration.stateAdvanceEndPartition( + TwoPartyArbitration.Context memory finalContext = TwoPartyArbitration + .stateAdvanceEndPartition( context, agree_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplitEnum.T memory epochHashSplit = - TwoPartyArbitrationEnum.getEpochHashSplitVariant( - finalContext.state - ); + EpochHashSplitEnum.T memory epochHashSplit = TwoPartyArbitrationEnum + .getEpochHashSplitVariant(finalContext.state); - EpochHashSplit.WaitingSubhashes memory epochHashSplit_subhashes = - EpochHashSplitEnum.getWaitingSubhashesVariant( - epochHashSplit - ); + EpochHashSplit.WaitingSubhashes + memory epochHashSplit_subhashes = EpochHashSplitEnum + .getWaitingSubhashesVariant(epochHashSplit); - assertEq(epochHashSplit_subhashes.postAdvanceEpochHashClaim, INTERMEDIATE_HASH); - assertEq(Merkle.unwrap(epochHashSplit_subhashes.preAdvanceMachine), Merkle.unwrap(preAdvanceMachine_)); - assertEq(Merkle.unwrap(epochHashSplit_subhashes.preAdvanceOutputs), Merkle.unwrap(preAdvanceOutputs_)); + assertEq( + epochHashSplit_subhashes.postAdvanceEpochHashClaim, + INTERMEDIATE_HASH + ); + assertEq( + Merkle.unwrap(epochHashSplit_subhashes.preAdvanceMachine), + Merkle.unwrap(preAdvanceMachine_) + ); + assertEq( + Merkle.unwrap(epochHashSplit_subhashes.preAdvanceOutputs), + Merkle.unwrap(preAdvanceOutputs_) + ); } - function testFail_stateAdvanceEndPartition() view public { + function testFail_stateAdvanceEndPartition() public view { /* we wont have a split on epoch hash as divergence point doesnt match epoch hash root*/ - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); uint64 finalPoint_ = 4; bool agree_ = false; - Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); + Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); - TwoPartyArbitration.Context memory context = - createContextofWaitingInterval( + TwoPartyArbitration.Context + memory context = createContextofWaitingInterval( args, INITIAL_POINT, finalPoint_ ); - TwoPartyArbitration.Context memory finalContext = - TwoPartyArbitration.stateAdvanceEndPartition( + TwoPartyArbitration.Context memory finalContext = TwoPartyArbitration + .stateAdvanceEndPartition( context, agree_, preAdvanceMachine_, preAdvanceOutputs_ ); - EpochHashSplitEnum.T memory epochHashSplit = - TwoPartyArbitrationEnum.getEpochHashSplitVariant( - finalContext.state - ); + EpochHashSplitEnum.T memory epochHashSplit = TwoPartyArbitrationEnum + .getEpochHashSplitVariant(finalContext.state); /*EpochHashSplit.WaitingSubhashes memory epochHashSplit_subhashes = EpochHashSplitEnum.getWaitingSubhashesVariant( epochHashSplit );*/ - EpochHashSplitEnum.getWaitingSubhashesVariant( - epochHashSplit - ); + EpochHashSplitEnum.getWaitingSubhashesVariant(epochHashSplit); } - // // Epoch hash split // function test_splitSupplySubhashes() public { - Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); - + Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); + /* claimer will submit postAdvanceMachine_ and postAdvanceOutputs_ and should match divergence epoch hash, in this case we modify the divergence epoch hash to match the current variables */ - TwoPartyArbitration.Context memory epochHash = - createCustomEpochHashSplit(); + TwoPartyArbitration.Context + memory epochHash = createCustomEpochHashSplit(); - TwoPartyArbitration.Context memory newEpochHashSplit = - TwoPartyArbitration.splitSupplySubhashes( + TwoPartyArbitration.Context + memory newEpochHashSplit = TwoPartyArbitration.splitSupplySubhashes( epochHash, postAdvanceMachine_, postAdvanceOutputs_ ); - + /* Untagging data */ - EpochHashSplitEnum.T memory epochHashSplit = - TwoPartyArbitrationEnum.getEpochHashSplitVariant( - newEpochHashSplit.state - ); + EpochHashSplitEnum.T memory epochHashSplit = TwoPartyArbitrationEnum + .getEpochHashSplitVariant(newEpochHashSplit.state); - EpochHashSplit.WaitingDivergence memory epochHashSplit_divergence = - EpochHashSplitEnum.getWaitingDivergenceVariant( - epochHashSplit - ); + EpochHashSplit.WaitingDivergence + memory epochHashSplit_divergence = EpochHashSplitEnum + .getWaitingDivergenceVariant(epochHashSplit); assertTrue( - Merkle.Hash.unwrap(epochHashSplit_divergence.postAdvanceMachineClaim) == - Merkle.Hash.unwrap(postAdvanceMachine_)); + Merkle.Hash.unwrap( + epochHashSplit_divergence.postAdvanceMachineClaim + ) == Merkle.Hash.unwrap(postAdvanceMachine_) + ); assertTrue( - Merkle.Hash.unwrap(epochHashSplit_divergence.postAdvanceOutputsClaim) == - Merkle.Hash.unwrap(postAdvanceOutputs_)); + Merkle.Hash.unwrap( + epochHashSplit_divergence.postAdvanceOutputsClaim + ) == Merkle.Hash.unwrap(postAdvanceOutputs_) + ); } /*function test_splitMachineDisagree() public { @@ -486,14 +476,13 @@ contract TestTwoPartyArbitration is Test { bytes32 claimerFinalHash, uint64 initialPoint, uint64 finalPoint - ) internal pure returns(Partition.WaitingHash memory) { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + ) internal pure returns (Partition.WaitingHash memory) { + Partition.WaitingHash memory waitingHash = Partition.createPartition( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); return waitingHash; } @@ -504,19 +493,15 @@ contract TestTwoPartyArbitration is Test { uint64 initialPoint, uint64 finalPoint, bytes32 intermediateHash - ) public pure returns(Partition.WaitingInterval memory) { - Partition.WaitingHash memory waitingHash = - createWaitingHash( - initialHash, - claimerFinalHash, - initialPoint, - finalPoint - ); - - return Partition.WaitingInterval( - waitingHash, - intermediateHash + ) public pure returns (Partition.WaitingInterval memory) { + Partition.WaitingHash memory waitingHash = createWaitingHash( + initialHash, + claimerFinalHash, + initialPoint, + finalPoint ); + + return Partition.WaitingInterval(waitingHash, intermediateHash); } function createContextofWaitingInterval( @@ -526,8 +511,8 @@ contract TestTwoPartyArbitration is Test { ) internal view returns (TwoPartyArbitration.Context memory) { //In this dispute, te sender must be the challenger. //So, we set the challenger to be the msg.sender. - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval( + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval( args.initialHash, args.claimedHash, initialPoint_, @@ -535,26 +520,30 @@ contract TestTwoPartyArbitration is Test { INTERMEDIATE_HASH ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); - - return TwoPartyArbitration.Context( - TwoPartyArbitration.ArbitrationArguments( - msg.sender, - args.claimer, - args.dataSource, - args.initialHash, - args.claimedHash, - args.epochIndex, - args.numInputs, - args.timeAllowance, - args.maxCycle - ), - - GameClockLib.newTimerChallengerTurn(block.timestamp, args.timeAllowance), - - TwoPartyArbitrationEnum.enumOfInputPartition(enumWaitingInterval) - ); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); + + return + TwoPartyArbitration.Context( + TwoPartyArbitration.ArbitrationArguments( + msg.sender, + args.claimer, + args.dataSource, + args.initialHash, + args.claimedHash, + args.epochIndex, + args.numInputs, + args.timeAllowance, + args.maxCycle + ), + GameClockLib.newTimerChallengerTurn( + block.timestamp, + args.timeAllowance + ), + TwoPartyArbitrationEnum.enumOfInputPartition( + enumWaitingInterval + ) + ); } function compareContext( @@ -573,11 +562,11 @@ contract TestTwoPartyArbitration is Test { PartitionEnum.T memory tpae1, PartitionEnum.T memory tpae2 ) public { - Partition.WaitingHash memory waitingHash1 = - PartitionEnum.getWaitingHashVariant(tpae1); + Partition.WaitingHash memory waitingHash1 = PartitionEnum + .getWaitingHashVariant(tpae1); - Partition.WaitingHash memory waitingHash2 = - PartitionEnum.getWaitingHashVariant(tpae2); + Partition.WaitingHash memory waitingHash2 = PartitionEnum + .getWaitingHashVariant(tpae2); assertTrue(tpae1._tag == tpae2._tag); assertEq(waitingHash1.agreePoint, waitingHash2.agreePoint); @@ -597,9 +586,8 @@ contract TestTwoPartyArbitration is Test { uint256 timeAllowance_, uint64 maxCycle_ ) internal view returns (TwoPartyArbitration.Context memory) { - - TwoPartyArbitration.ArbitrationArguments memory arguments = - TwoPartyArbitration.ArbitrationArguments( + TwoPartyArbitration.ArbitrationArguments + memory arguments = TwoPartyArbitration.ArbitrationArguments( challenger_, claimer_, dataSource_, @@ -611,32 +599,32 @@ contract TestTwoPartyArbitration is Test { maxCycle_ ); - return TwoPartyArbitration.createArbitration( - arguments - ); + return TwoPartyArbitration.createArbitration(arguments); } function createContext( TwoPartyArbitration.ArbitrationArguments memory args ) internal view returns (TwoPartyArbitration.Context memory) { - return TwoPartyArbitration.createArbitration( - args - ); + return TwoPartyArbitration.createArbitration(args); } - function createSampleArbitrationArguments( - ) internal view returns (TwoPartyArbitration.ArbitrationArguments memory) { - return TwoPartyArbitration.ArbitrationArguments( - PLAYER1_ADDRESS, - PLAYER2_ADDRESS, - DATA_SOURCE, - INITIAL_HASH, - CLAIMER_FINAL_HASH, - 0, - 3, - 2, - 1 - ); + function createSampleArbitrationArguments() + internal + view + returns (TwoPartyArbitration.ArbitrationArguments memory) + { + return + TwoPartyArbitration.ArbitrationArguments( + PLAYER1_ADDRESS, + PLAYER2_ADDRESS, + DATA_SOURCE, + INITIAL_HASH, + CLAIMER_FINAL_HASH, + 0, + 3, + 2, + 1 + ); } function createRandomSampleArbitrationArguments( @@ -651,36 +639,48 @@ contract TestTwoPartyArbitration is Test { ) internal returns (TwoPartyArbitration.ArbitrationArguments memory) { vm.assume(numInputs_ > 2); vm.assume(timeAllowance_ > 1); - return TwoPartyArbitration.ArbitrationArguments( - challenger_, - claimer_, - DATA_SOURCE, - initialHash_, - claimedHash_, - epochIndex_, - numInputs_, - timeAllowance_, - maxCycle_ - ); + return + TwoPartyArbitration.ArbitrationArguments( + challenger_, + claimer_, + DATA_SOURCE, + initialHash_, + claimedHash_, + epochIndex_, + numInputs_, + timeAllowance_, + maxCycle_ + ); } - function createCustomEpochHashSplit() internal view returns (TwoPartyArbitration.Context memory) { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - args.initialHash = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + function createCustomEpochHashSplit() + internal + view + returns (TwoPartyArbitration.Context memory) + { + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + args.initialHash = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); uint64 finalPoint_ = 4; bool agree_ = false; - Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); - bytes32 customEpochHashDivergence = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); + bytes32 customEpochHashDivergence = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); - /* claimer will submit postAdvanceMachine_ and postAdvanceOutputs_ and should match divergence epoch hash, in this case we modify the divergence epoch hash to match the current variables */ - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval( + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval( args.initialHash, args.claimedHash, INITIAL_POINT, @@ -688,36 +688,38 @@ contract TestTwoPartyArbitration is Test { customEpochHashDivergence ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); - - TwoPartyArbitration.Context memory context = TwoPartyArbitration.Context( - TwoPartyArbitration.ArbitrationArguments( - msg.sender, - msg.sender, - args.dataSource, - args.initialHash, - args.claimedHash, - args.epochIndex, - args.numInputs, - args.timeAllowance, - args.maxCycle - ), - - GameClockLib.newTimerChallengerTurn(block.timestamp, args.timeAllowance), - - TwoPartyArbitrationEnum.enumOfInputPartition(enumWaitingInterval) - ); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .Context( + TwoPartyArbitration.ArbitrationArguments( + msg.sender, + msg.sender, + args.dataSource, + args.initialHash, + args.claimedHash, + args.epochIndex, + args.numInputs, + args.timeAllowance, + args.maxCycle + ), + GameClockLib.newTimerChallengerTurn( + block.timestamp, + args.timeAllowance + ), + TwoPartyArbitrationEnum.enumOfInputPartition( + enumWaitingInterval + ) + ); return ( TwoPartyArbitration.stateAdvanceEndPartition( context, agree_, preAdvanceMachine_, - preAdvanceOutputs_ + preAdvanceOutputs_ ) ); - } } - diff --git a/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitrationEnum.t.sol b/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitrationEnum.t.sol index be8a6275c..226be80ce 100644 --- a/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitrationEnum.t.sol +++ b/onchain/rollups-arbitration/test/two-party-arbitration/TwoPartyArbitrationEnum.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.13; @@ -21,8 +12,7 @@ import "../../src/two-party-arbitration/TwoPartyArbitration.sol"; import "./TwoPartyArbitration.t.sol"; - -import { Merkle } from "utils/Merkle.sol"; +import {Merkle} from "utils/Merkle.sol"; contract TestTwoPartyArbitrationEnum is Test { using Merkle for Merkle.Hash; @@ -34,180 +24,165 @@ contract TestTwoPartyArbitrationEnum is Test { */ function test_enumOfInputPartition() public { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - - TwoPartyArbitration.Context memory context = - TwoPartyArbitration.createArbitration( - args - ); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .createArbitration(args); assertTrue( - TwoPartyArbitrationEnum.isInputPartitionVariant( - context.state - ) + TwoPartyArbitrationEnum.isInputPartitionVariant(context.state) ); } - + function testFail_isInputPartitionVariant() public { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - - TwoPartyArbitration.Context memory context = - TwoPartyArbitration.createArbitration( - args - ); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .createArbitration(args); assertFalse( - TwoPartyArbitrationEnum.isInputPartitionVariant( - context.state - ) + TwoPartyArbitrationEnum.isInputPartitionVariant(context.state) ); } function test_getInputPartitionVariant() public { - TwoPartyArbitration.Context memory context = - createInputPartitionVariant(); + TwoPartyArbitration.Context + memory context = createInputPartitionVariant(); + + PartitionEnum.T memory enumWaitingInterval = TwoPartyArbitrationEnum + .getInputPartitionVariant(context.state); - - PartitionEnum.T memory enumWaitingInterval = - TwoPartyArbitrationEnum.getInputPartitionVariant( - context.state - ); - assertTrue(PartitionEnum.isWaitingIntervalVariant(enumWaitingInterval)); } /* * @dev Tests the `EpochHashSplit` variant. */ - + function test_enumOfEpochHashSplit() public { - TwoPartyArbitration.Context memory finalContext = - createEpochHashSplit(); + TwoPartyArbitration.Context + memory finalContext = createEpochHashSplit(); assertTrue( - TwoPartyArbitrationEnum.isEpochHashSplitVariant( - finalContext.state - ) + TwoPartyArbitrationEnum.isEpochHashSplitVariant(finalContext.state) ); } function testFail_isEpochHashSplitVariant() public { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - - TwoPartyArbitration.Context memory context = - TwoPartyArbitration.createArbitration( - args - ); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .createArbitration(args); assertTrue( - TwoPartyArbitrationEnum.isEpochHashSplitVariant( - context.state - ) + TwoPartyArbitrationEnum.isEpochHashSplitVariant(context.state) ); } function test_getEpochHashSplitVariant() public { - TwoPartyArbitration.Context memory finalContext = - createEpochHashSplit(); + TwoPartyArbitration.Context + memory finalContext = createEpochHashSplit(); - EpochHashSplitEnum.T memory epochHashSplit = - TwoPartyArbitrationEnum.getEpochHashSplitVariant( - finalContext.state - ); - - EpochHashSplit.WaitingSubhashes memory epochHashSplit_subhashes = - EpochHashSplitEnum.getWaitingSubhashesVariant( - epochHashSplit - ); + EpochHashSplitEnum.T memory epochHashSplit = TwoPartyArbitrationEnum + .getEpochHashSplitVariant(finalContext.state); + + EpochHashSplit.WaitingSubhashes + memory epochHashSplit_subhashes = EpochHashSplitEnum + .getWaitingSubhashesVariant(epochHashSplit); - assertEq(epochHashSplit_subhashes.postAdvanceEpochHashClaim, INTERMEDIATE_HASH); + assertEq( + epochHashSplit_subhashes.postAdvanceEpochHashClaim, + INTERMEDIATE_HASH + ); } /* * @dev Tests the `MachineSplice` variant. */ - + function test_enumOfMachineSplice() public { - Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); - + Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); + /* claimer will submit postAdvanceMachine_ and postAdvanceOutputs_ and should match divergence epoch hash, in this case we modify the divergence epoch hash to match the current variables */ - TwoPartyArbitration.Context memory epochHash = - createCustomEpochHashSplit(); + TwoPartyArbitration.Context + memory epochHash = createCustomEpochHashSplit(); - TwoPartyArbitration.Context memory newEpochHashSplit = - TwoPartyArbitration.splitSupplySubhashes( + TwoPartyArbitration.Context + memory newEpochHashSplit = TwoPartyArbitration.splitSupplySubhashes( epochHash, postAdvanceMachine_, postAdvanceOutputs_ ); - - TwoPartyArbitration.Context memory machineSplice = - TwoPartyArbitration.splitMachineDisagree(newEpochHashSplit); - + + TwoPartyArbitration.Context memory machineSplice = TwoPartyArbitration + .splitMachineDisagree(newEpochHashSplit); + assertTrue( - TwoPartyArbitrationEnum.isMachineSpliceVariant( - machineSplice.state - ) + TwoPartyArbitrationEnum.isMachineSpliceVariant(machineSplice.state) ); } function testFail_isMachineSpliceVariant() public { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - - TwoPartyArbitration.Context memory context = - TwoPartyArbitration.createArbitration( - args - ); + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .createArbitration(args); assertTrue( - TwoPartyArbitrationEnum.isMachineSpliceVariant( - context.state - ) + TwoPartyArbitrationEnum.isMachineSpliceVariant(context.state) ); } - function test_getMachineSpliceVariant() public view{ - Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); - + function test_getMachineSpliceVariant() public view { + Merkle.Hash postAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash postAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); + /* claimer will submit postAdvanceMachine_ and postAdvanceOutputs_ and should match divergence epoch hash, in this case we modify the divergence epoch hash to match the current variables */ - TwoPartyArbitration.Context memory epochHash = - createCustomEpochHashSplit(); + TwoPartyArbitration.Context + memory epochHash = createCustomEpochHashSplit(); - TwoPartyArbitration.Context memory newEpochHashSplit = - TwoPartyArbitration.splitSupplySubhashes( + TwoPartyArbitration.Context + memory newEpochHashSplit = TwoPartyArbitration.splitSupplySubhashes( epochHash, postAdvanceMachine_, postAdvanceOutputs_ ); - - TwoPartyArbitration.Context memory contextMachineSplice = - TwoPartyArbitration.splitMachineDisagree(newEpochHashSplit); + + TwoPartyArbitration.Context + memory contextMachineSplice = TwoPartyArbitration + .splitMachineDisagree(newEpochHashSplit); TwoPartyArbitrationEnum.getMachineSpliceVariant( contextMachineSplice.state ); - + /*SpliceMachineEnum.T memory machineSplice2 = TwoPartyArbitrationEnum.getMachineSpliceVariant( contextMachineSplice.state );*/ - // TODO: COMPARE THIS BUT WE HAVE TO UNBOX IT FIRST + // TODO: COMPARE THIS BUT WE HAVE TO UNBOX IT FIRST //assertTrue(contextMachineSplice.state == machineSplice2 ) /*assertTrue(machineSplice2.preAdvanceMachine == postAdvanceMachine_); assertTrue(machineSplice2.postAdvanceMachineClaim == postAdvanceOutputs_);*/ - } /* @@ -241,7 +216,7 @@ contract TestTwoPartyArbitrationEnum is Test { function test_ggetProveMemoryVariant() public { }*/ - + /* Internal helper methods */ @@ -266,30 +241,39 @@ contract TestTwoPartyArbitrationEnum is Test { uint64 constant INITIAL_POINT = 1; uint64 constant FINAL_POINT = 5; - function createSampleArbitrationArguments( - ) internal view returns (TwoPartyArbitration.ArbitrationArguments memory) { - return TwoPartyArbitration.ArbitrationArguments( - PLAYER1_ADDRESS, - PLAYER2_ADDRESS, - DATA_SOURCE, - INITIAL_HASH, - CLAIMER_FINAL_HASH, - 0, - 3, - 2, - 1 - ); + function createSampleArbitrationArguments() + internal + view + returns (TwoPartyArbitration.ArbitrationArguments memory) + { + return + TwoPartyArbitration.ArbitrationArguments( + PLAYER1_ADDRESS, + PLAYER2_ADDRESS, + DATA_SOURCE, + INITIAL_HASH, + CLAIMER_FINAL_HASH, + 0, + 3, + 2, + 1 + ); } - function createInputPartitionVariant( - ) internal view returns(TwoPartyArbitration.Context memory){ - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - args.initialHash = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + function createInputPartitionVariant() + internal + view + returns (TwoPartyArbitration.Context memory) + { + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + args.initialHash = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); uint64 finalPoint_ = 4; - TwoPartyArbitration.Context memory context = - createContextofWaitingInterval( + TwoPartyArbitration.Context + memory context = createContextofWaitingInterval( args, INITIAL_POINT, finalPoint_ @@ -305,8 +289,8 @@ contract TestTwoPartyArbitrationEnum is Test { ) internal view returns (TwoPartyArbitration.Context memory) { //In this dispute, te sender must be the challenger. //So, we set the challenger to be the msg.sender. - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval( + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval( args.initialHash, args.claimedHash, initialPoint_, @@ -314,26 +298,30 @@ contract TestTwoPartyArbitrationEnum is Test { INTERMEDIATE_HASH ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); - - return TwoPartyArbitration.Context( - TwoPartyArbitration.ArbitrationArguments( - msg.sender, - args.challenger, //just changed from msg.sender to args.challenger - args.dataSource, - args.initialHash, - args.claimedHash, - args.epochIndex, - args.numInputs, - args.timeAllowance, - args.maxCycle - ), - - GameClockLib.newTimerChallengerTurn(block.timestamp, args.timeAllowance), - - TwoPartyArbitrationEnum.enumOfInputPartition(enumWaitingInterval) - ); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); + + return + TwoPartyArbitration.Context( + TwoPartyArbitration.ArbitrationArguments( + msg.sender, + args.challenger, //just changed from msg.sender to args.challenger + args.dataSource, + args.initialHash, + args.claimedHash, + args.epochIndex, + args.numInputs, + args.timeAllowance, + args.maxCycle + ), + GameClockLib.newTimerChallengerTurn( + block.timestamp, + args.timeAllowance + ), + TwoPartyArbitrationEnum.enumOfInputPartition( + enumWaitingInterval + ) + ); } function createWaitingHash( @@ -341,14 +329,13 @@ contract TestTwoPartyArbitrationEnum is Test { bytes32 claimerFinalHash, uint64 initialPoint, uint64 finalPoint - ) internal pure returns(Partition.WaitingHash memory) { - Partition.WaitingHash memory waitingHash = - Partition.createPartition( - initialPoint, - finalPoint, - initialHash, - claimerFinalHash - ); + ) internal pure returns (Partition.WaitingHash memory) { + Partition.WaitingHash memory waitingHash = Partition.createPartition( + initialPoint, + finalPoint, + initialHash, + claimerFinalHash + ); return waitingHash; } @@ -359,32 +346,38 @@ contract TestTwoPartyArbitrationEnum is Test { uint64 initialPoint, uint64 finalPoint, bytes32 intermediateHash - ) public pure returns(Partition.WaitingInterval memory) { - Partition.WaitingHash memory waitingHash = - createWaitingHash( - initialHash, - claimerFinalHash, - initialPoint, - finalPoint - ); - - return Partition.WaitingInterval( - waitingHash, - intermediateHash + ) public pure returns (Partition.WaitingInterval memory) { + Partition.WaitingHash memory waitingHash = createWaitingHash( + initialHash, + claimerFinalHash, + initialPoint, + finalPoint ); + + return Partition.WaitingInterval(waitingHash, intermediateHash); } - function createEpochHashSplit() internal view returns (TwoPartyArbitration.Context memory) { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - args.initialHash = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + function createEpochHashSplit() + internal + view + returns (TwoPartyArbitration.Context memory) + { + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + args.initialHash = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); uint64 finalPoint_ = 4; bool agree_ = false; - Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); + Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); - TwoPartyArbitration.Context memory context = - createContextofWaitingInterval( + TwoPartyArbitration.Context + memory context = createContextofWaitingInterval( args, INITIAL_POINT, finalPoint_ @@ -400,23 +393,34 @@ contract TestTwoPartyArbitrationEnum is Test { ); } - function createCustomEpochHashSplit() internal view returns (TwoPartyArbitration.Context memory) { - TwoPartyArbitration.ArbitrationArguments memory args = - createSampleArbitrationArguments(); - args.initialHash = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + function createCustomEpochHashSplit() + internal + view + returns (TwoPartyArbitration.Context memory) + { + TwoPartyArbitration.ArbitrationArguments + memory args = createSampleArbitrationArguments(); + args.initialHash = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); uint64 finalPoint_ = 4; bool agree_ = false; - Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000004); - Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap(0x0000000000000000000000000000000000000000000000000000000000000005); - bytes32 customEpochHashDivergence = bytes32(0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05); + Merkle.Hash preAdvanceMachine_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000004 + ); + Merkle.Hash preAdvanceOutputs_ = Merkle.Hash.wrap( + 0x0000000000000000000000000000000000000000000000000000000000000005 + ); + bytes32 customEpochHashDivergence = bytes32( + 0x04cde762ef08b6b6c5ded8e8c4c0b3f4e5c9ad7342c88fcc93681b4588b73f05 + ); - /* claimer will submit postAdvanceMachine_ and postAdvanceOutputs_ and should match divergence epoch hash, in this case we modify the divergence epoch hash to match the current variables */ - Partition.WaitingInterval memory waitingInterval = - createWaitingInterval( + Partition.WaitingInterval + memory waitingInterval = createWaitingInterval( args.initialHash, args.claimedHash, INITIAL_POINT, @@ -424,38 +428,38 @@ contract TestTwoPartyArbitrationEnum is Test { customEpochHashDivergence ); - PartitionEnum.T memory enumWaitingInterval = - PartitionEnum.enumOfWaitingInterval(waitingInterval); - - TwoPartyArbitration.Context memory context = TwoPartyArbitration.Context( - TwoPartyArbitration.ArbitrationArguments( - msg.sender, - msg.sender, - args.dataSource, - args.initialHash, - args.claimedHash, - args.epochIndex, - args.numInputs, - args.timeAllowance, - args.maxCycle - ), - - GameClockLib.newTimerChallengerTurn(block.timestamp, args.timeAllowance), - - TwoPartyArbitrationEnum.enumOfInputPartition(enumWaitingInterval) - ); + PartitionEnum.T memory enumWaitingInterval = PartitionEnum + .enumOfWaitingInterval(waitingInterval); + + TwoPartyArbitration.Context memory context = TwoPartyArbitration + .Context( + TwoPartyArbitration.ArbitrationArguments( + msg.sender, + msg.sender, + args.dataSource, + args.initialHash, + args.claimedHash, + args.epochIndex, + args.numInputs, + args.timeAllowance, + args.maxCycle + ), + GameClockLib.newTimerChallengerTurn( + block.timestamp, + args.timeAllowance + ), + TwoPartyArbitrationEnum.enumOfInputPartition( + enumWaitingInterval + ) + ); return ( TwoPartyArbitration.stateAdvanceEndPartition( context, agree_, preAdvanceMachine_, - preAdvanceOutputs_ + preAdvanceOutputs_ ) ); - } - - } - diff --git a/onchain/rollups-cli/src/args.ts b/onchain/rollups-cli/src/args.ts index 4f799ec81..bc18af2c2 100644 --- a/onchain/rollups-cli/src/args.ts +++ b/onchain/rollups-cli/src/args.ts @@ -1,13 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import { ethers } from "ethers"; import { Argv } from "yargs"; diff --git a/onchain/rollups-cli/src/cli.ts b/onchain/rollups-cli/src/cli.ts index a39e85d3d..8a642334d 100644 --- a/onchain/rollups-cli/src/cli.ts +++ b/onchain/rollups-cli/src/cli.ts @@ -1,14 +1,6 @@ #!/usr/bin/env node -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import yargs from "yargs"; import { hideBin } from "yargs/helpers"; diff --git a/onchain/rollups-cli/src/commands/create.ts b/onchain/rollups-cli/src/commands/create.ts index 32ebf3c5e..2ea88e681 100644 --- a/onchain/rollups-cli/src/commands/create.ts +++ b/onchain/rollups-cli/src/commands/create.ts @@ -1,13 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import fs from "fs"; import fse from "fs-extra"; diff --git a/onchain/rollups-cli/src/connect.ts b/onchain/rollups-cli/src/connect.ts index c1eba139b..04cd6ae8b 100644 --- a/onchain/rollups-cli/src/connect.ts +++ b/onchain/rollups-cli/src/connect.ts @@ -1,13 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import fs from "fs"; import { JsonRpcProvider } from "@ethersproject/providers"; diff --git a/onchain/rollups-cli/src/util.ts b/onchain/rollups-cli/src/util.ts index 422488b0f..56314a844 100644 --- a/onchain/rollups-cli/src/util.ts +++ b/onchain/rollups-cli/src/util.ts @@ -1,16 +1,8 @@ -// Copyright Cartesi Pte. Ltd. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import { ArgumentsCamelCase } from "yargs"; -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - type Handler = (args: ArgumentsCamelCase) => void | Promise; /** diff --git a/onchain/rollups/abi/contracts/dapp/CartesiDApp.sol/CartesiDApp.json b/onchain/rollups/abi/contracts/dapp/CartesiDApp.sol/CartesiDApp.json index c52b39f02..a89511c70 100644 --- a/onchain/rollups/abi/contracts/dapp/CartesiDApp.sol/CartesiDApp.json +++ b/onchain/rollups/abi/contracts/dapp/CartesiDApp.sol/CartesiDApp.json @@ -468,7 +468,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_inboxInputIndex", + "name": "_inputIndex", "type": "uint256" }, { diff --git a/onchain/rollups/abi/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json b/onchain/rollups/abi/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json index 848363084..aa6df671f 100644 --- a/onchain/rollups/abi/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json +++ b/onchain/rollups/abi/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json @@ -229,7 +229,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_inboxInputIndex", + "name": "_inputIndex", "type": "uint256" }, { diff --git a/onchain/rollups/abi/contracts/inputs/IInputBox.sol/IInputBox.json b/onchain/rollups/abi/contracts/inputs/IInputBox.sol/IInputBox.json index 5dc5a68f7..e9801b108 100644 --- a/onchain/rollups/abi/contracts/inputs/IInputBox.sol/IInputBox.json +++ b/onchain/rollups/abi/contracts/inputs/IInputBox.sol/IInputBox.json @@ -11,7 +11,7 @@ { "indexed": true, "internalType": "uint256", - "name": "inboxInputIndex", + "name": "inputIndex", "type": "uint256" }, { diff --git a/onchain/rollups/abi/contracts/inputs/InputBox.sol/InputBox.json b/onchain/rollups/abi/contracts/inputs/InputBox.sol/InputBox.json index 34260475c..2bb2dd5a2 100644 --- a/onchain/rollups/abi/contracts/inputs/InputBox.sol/InputBox.json +++ b/onchain/rollups/abi/contracts/inputs/InputBox.sol/InputBox.json @@ -16,7 +16,7 @@ { "indexed": true, "internalType": "uint256", - "name": "inboxInputIndex", + "name": "inputIndex", "type": "uint256" }, { diff --git a/onchain/rollups/contracts/common/CanonicalMachine.sol b/onchain/rollups/contracts/common/CanonicalMachine.sol index 8f19efa00..2a7d6719f 100644 --- a/onchain/rollups/contracts/common/CanonicalMachine.sol +++ b/onchain/rollups/contracts/common/CanonicalMachine.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/common/InputEncoding.sol b/onchain/rollups/contracts/common/InputEncoding.sol index 9b6754edd..63c8883fb 100644 --- a/onchain/rollups/contracts/common/InputEncoding.sol +++ b/onchain/rollups/contracts/common/InputEncoding.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/common/OutputEncoding.sol b/onchain/rollups/contracts/common/OutputEncoding.sol index beef36f41..a009ee0e3 100644 --- a/onchain/rollups/contracts/common/OutputEncoding.sol +++ b/onchain/rollups/contracts/common/OutputEncoding.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/consensus/AbstractConsensus.sol b/onchain/rollups/contracts/consensus/AbstractConsensus.sol index a7c6faecb..f28e45c83 100644 --- a/onchain/rollups/contracts/consensus/AbstractConsensus.sol +++ b/onchain/rollups/contracts/consensus/AbstractConsensus.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/consensus/IConsensus.sol b/onchain/rollups/contracts/consensus/IConsensus.sol index 66cdf7213..3034e7cf1 100644 --- a/onchain/rollups/contracts/consensus/IConsensus.sol +++ b/onchain/rollups/contracts/consensus/IConsensus.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/consensus/authority/Authority.sol b/onchain/rollups/contracts/consensus/authority/Authority.sol index 13a5bd1c4..6eb19bda1 100644 --- a/onchain/rollups/contracts/consensus/authority/Authority.sol +++ b/onchain/rollups/contracts/consensus/authority/Authority.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/dapp/CartesiDApp.sol b/onchain/rollups/contracts/dapp/CartesiDApp.sol index 35c189003..6d5313d95 100644 --- a/onchain/rollups/contracts/dapp/CartesiDApp.sol +++ b/onchain/rollups/contracts/dapp/CartesiDApp.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/dapp/CartesiDAppFactory.sol b/onchain/rollups/contracts/dapp/CartesiDAppFactory.sol index 519f20562..49d28b051 100644 --- a/onchain/rollups/contracts/dapp/CartesiDAppFactory.sol +++ b/onchain/rollups/contracts/dapp/CartesiDAppFactory.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/dapp/ICartesiDApp.sol b/onchain/rollups/contracts/dapp/ICartesiDApp.sol index 45f246338..0ae573835 100644 --- a/onchain/rollups/contracts/dapp/ICartesiDApp.sol +++ b/onchain/rollups/contracts/dapp/ICartesiDApp.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/dapp/ICartesiDAppFactory.sol b/onchain/rollups/contracts/dapp/ICartesiDAppFactory.sol index c5b273b7f..c297842d7 100644 --- a/onchain/rollups/contracts/dapp/ICartesiDAppFactory.sol +++ b/onchain/rollups/contracts/dapp/ICartesiDAppFactory.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/history/History.sol b/onchain/rollups/contracts/history/History.sol index f2445d32b..ce02247ec 100644 --- a/onchain/rollups/contracts/history/History.sol +++ b/onchain/rollups/contracts/history/History.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/history/IHistory.sol b/onchain/rollups/contracts/history/IHistory.sol index 1e98e3944..52158d4e8 100644 --- a/onchain/rollups/contracts/history/IHistory.sol +++ b/onchain/rollups/contracts/history/IHistory.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/inputs/IInputBox.sol b/onchain/rollups/contracts/inputs/IInputBox.sol index af7b5760e..521de8e50 100644 --- a/onchain/rollups/contracts/inputs/IInputBox.sol +++ b/onchain/rollups/contracts/inputs/IInputBox.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/inputs/IInputRelay.sol b/onchain/rollups/contracts/inputs/IInputRelay.sol index 15fc05716..ed607d2ca 100644 --- a/onchain/rollups/contracts/inputs/IInputRelay.sol +++ b/onchain/rollups/contracts/inputs/IInputRelay.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/inputs/InputBox.sol b/onchain/rollups/contracts/inputs/InputBox.sol index ae4262c37..6999a1955 100644 --- a/onchain/rollups/contracts/inputs/InputBox.sol +++ b/onchain/rollups/contracts/inputs/InputBox.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/inputs/InputRelay.sol b/onchain/rollups/contracts/inputs/InputRelay.sol index 501407c44..b2eabd81a 100644 --- a/onchain/rollups/contracts/inputs/InputRelay.sol +++ b/onchain/rollups/contracts/inputs/InputRelay.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/library/LibInput.sol b/onchain/rollups/contracts/library/LibInput.sol index 691eed9ac..1cae79cb5 100644 --- a/onchain/rollups/contracts/library/LibInput.sol +++ b/onchain/rollups/contracts/library/LibInput.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/library/LibOutputValidation.sol b/onchain/rollups/contracts/library/LibOutputValidation.sol index e326b0fab..3cfddf790 100644 --- a/onchain/rollups/contracts/library/LibOutputValidation.sol +++ b/onchain/rollups/contracts/library/LibOutputValidation.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/ERC1155BatchPortal.sol b/onchain/rollups/contracts/portals/ERC1155BatchPortal.sol index 769420db3..1aeee7c7a 100644 --- a/onchain/rollups/contracts/portals/ERC1155BatchPortal.sol +++ b/onchain/rollups/contracts/portals/ERC1155BatchPortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/ERC1155SinglePortal.sol b/onchain/rollups/contracts/portals/ERC1155SinglePortal.sol index 20a1b9ef1..747a2b62f 100644 --- a/onchain/rollups/contracts/portals/ERC1155SinglePortal.sol +++ b/onchain/rollups/contracts/portals/ERC1155SinglePortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/ERC20Portal.sol b/onchain/rollups/contracts/portals/ERC20Portal.sol index 424338057..561714eb2 100644 --- a/onchain/rollups/contracts/portals/ERC20Portal.sol +++ b/onchain/rollups/contracts/portals/ERC20Portal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/ERC721Portal.sol b/onchain/rollups/contracts/portals/ERC721Portal.sol index 252a11de2..0e36bbe58 100644 --- a/onchain/rollups/contracts/portals/ERC721Portal.sol +++ b/onchain/rollups/contracts/portals/ERC721Portal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/EtherPortal.sol b/onchain/rollups/contracts/portals/EtherPortal.sol index 0b9a549ed..46a9a9ba5 100644 --- a/onchain/rollups/contracts/portals/EtherPortal.sol +++ b/onchain/rollups/contracts/portals/EtherPortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/IERC1155BatchPortal.sol b/onchain/rollups/contracts/portals/IERC1155BatchPortal.sol index 28e51c794..168c72a22 100644 --- a/onchain/rollups/contracts/portals/IERC1155BatchPortal.sol +++ b/onchain/rollups/contracts/portals/IERC1155BatchPortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/IERC1155SinglePortal.sol b/onchain/rollups/contracts/portals/IERC1155SinglePortal.sol index 93ef218e6..ce3556892 100644 --- a/onchain/rollups/contracts/portals/IERC1155SinglePortal.sol +++ b/onchain/rollups/contracts/portals/IERC1155SinglePortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/IERC20Portal.sol b/onchain/rollups/contracts/portals/IERC20Portal.sol index 5e0bbbaf5..ec2f404e7 100644 --- a/onchain/rollups/contracts/portals/IERC20Portal.sol +++ b/onchain/rollups/contracts/portals/IERC20Portal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/IERC721Portal.sol b/onchain/rollups/contracts/portals/IERC721Portal.sol index 90feb8fde..93d10dc62 100644 --- a/onchain/rollups/contracts/portals/IERC721Portal.sol +++ b/onchain/rollups/contracts/portals/IERC721Portal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/portals/IEtherPortal.sol b/onchain/rollups/contracts/portals/IEtherPortal.sol index dcc7766da..a99aaa37c 100644 --- a/onchain/rollups/contracts/portals/IEtherPortal.sol +++ b/onchain/rollups/contracts/portals/IEtherPortal.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/relays/DAppAddressRelay.sol b/onchain/rollups/contracts/relays/DAppAddressRelay.sol index e6a9d5343..ff3520e3a 100644 --- a/onchain/rollups/contracts/relays/DAppAddressRelay.sol +++ b/onchain/rollups/contracts/relays/DAppAddressRelay.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/contracts/relays/IDAppAddressRelay.sol b/onchain/rollups/contracts/relays/IDAppAddressRelay.sol index 521aef6a8..3d2b0c7df 100644 --- a/onchain/rollups/contracts/relays/IDAppAddressRelay.sol +++ b/onchain/rollups/contracts/relays/IDAppAddressRelay.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) pragma solidity ^0.8.8; diff --git a/onchain/rollups/deploy/01_input.ts b/onchain/rollups/deploy/01_input.ts index 1aaea8feb..679a8cdad 100644 --- a/onchain/rollups/deploy/01_input.ts +++ b/onchain/rollups/deploy/01_input.ts @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the license at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction, DeployOptions } from "hardhat-deploy/types"; diff --git a/onchain/rollups/deploy/02_factory.ts b/onchain/rollups/deploy/02_factory.ts index 679a096f1..5498da64f 100644 --- a/onchain/rollups/deploy/02_factory.ts +++ b/onchain/rollups/deploy/02_factory.ts @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the license at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction, DeployOptions } from "hardhat-deploy/types"; diff --git a/onchain/rollups/deploy/03_authority.ts b/onchain/rollups/deploy/03_authority.ts index 2e07dab4c..5f7d5c6ff 100644 --- a/onchain/rollups/deploy/03_authority.ts +++ b/onchain/rollups/deploy/03_authority.ts @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the license at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction, DeployOptions } from "hardhat-deploy/types"; diff --git a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/Create2.sol/Create2.json b/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/Create2.sol/Create2.json deleted file mode 100644 index 162dc2022..000000000 --- a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/Create2.sol/Create2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "contractName": "Create2", - "sourceName": "@openzeppelin/contracts/utils/Create2.sol", - "abi": [], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ffd2a503893922a87603a7a06ebe2fb025d7c4a9d50a7cc9a617375be65742c864736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ffd2a503893922a87603a7a06ebe2fb025d7c4a9d50a7cc9a617375be65742c864736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "details": "Helper to make usage of the `CREATE2` EVM opcode easier and safer. `CREATE2` can be used to compute in advance the address where a smart contract will be deployed, which allows for interesting new mechanisms known as 'counterfactual interactions'. See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more information.", - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "computeAddress(bytes32,bytes32)": "infinite", - "computeAddress(bytes32,bytes32,address)": "infinite", - "deploy(uint256,bytes32,bytes memory)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json b/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json deleted file mode 100644 index e24aada65..000000000 --- a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "contractName": "ERC165", - "sourceName": "@openzeppelin/contracts/utils/introspection/ERC165.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "details": "Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.", - "kind": "dev", - "methods": { - "supportsInterface(bytes4)": { - "details": "See {IERC165-supportsInterface}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "supportsInterface(bytes4)": "01ffc9a7" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json b/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json deleted file mode 100644 index 72306c728..000000000 --- a/onchain/rollups/export/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "contractName": "IERC165", - "sourceName": "@openzeppelin/contracts/utils/introspection/IERC165.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "details": "Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.", - "kind": "dev", - "methods": { - "supportsInterface(bytes4)": { - "details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "supportsInterface(bytes4)": "01ffc9a7" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/common/CanonicalMachine.sol/CanonicalMachine.json b/onchain/rollups/export/artifacts/contracts/common/CanonicalMachine.sol/CanonicalMachine.json deleted file mode 100644 index bd5c9592e..000000000 --- a/onchain/rollups/export/artifacts/contracts/common/CanonicalMachine.sol/CanonicalMachine.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "contractName": "CanonicalMachine", - "sourceName": "contracts/common/CanonicalMachine.sol", - "abi": [], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203d558fcea58f2bdc9741966c5bdd937251d161c25ca9e7215e1b967f791ca9d564736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203d558fcea58f2bdc9741966c5bdd937251d161c25ca9e7215e1b967f791ca9d564736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "stateVariables": { - "INPUT_MAX_SIZE": { - "details": "The offset and size fields use up the extra 64 bytes." - } - }, - "title": "Canonical Machine Constants Library", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Defines several constants related to the reference implementation of the RISC-V machine that runs Linux, also known as the \"Cartesi Machine\".", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "getIntraMemoryRangePosition(uint64,CanonicalMachine.Log2Size)": "infinite", - "uint64OfSize(CanonicalMachine.Log2Size)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/common/InputEncoding.sol/InputEncoding.json b/onchain/rollups/export/artifacts/contracts/common/InputEncoding.sol/InputEncoding.json deleted file mode 100644 index 4d8834dea..000000000 --- a/onchain/rollups/export/artifacts/contracts/common/InputEncoding.sol/InputEncoding.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "contractName": "InputEncoding", - "sourceName": "contracts/common/InputEncoding.sol", - "abi": [], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201a4a828ac50df38ddc149d6ef1436a5734f8dd90c0488fa784d78c5c0838837564736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201a4a828ac50df38ddc149d6ef1436a5734f8dd90c0488fa784d78c5c0838837564736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Defines the encoding of inputs added by core trustless and permissionless contracts, such as portals and relays.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "encodeBatchERC1155Deposit(contract IERC1155,address,uint256[] calldata,uint256[] calldata,bytes calldata,bytes calldata)": "infinite", - "encodeDAppAddressRelay(address)": "infinite", - "encodeERC20Deposit(bool,contract IERC20,address,uint256,bytes calldata)": "infinite", - "encodeERC721Deposit(contract IERC721,address,uint256,bytes calldata,bytes calldata)": "infinite", - "encodeEtherDeposit(address,uint256,bytes calldata)": "infinite", - "encodeSingleERC1155Deposit(contract IERC1155,address,uint256,uint256,bytes calldata,bytes calldata)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/common/OutputEncoding.sol/OutputEncoding.json b/onchain/rollups/export/artifacts/contracts/common/OutputEncoding.sol/OutputEncoding.json deleted file mode 100644 index 6def00702..000000000 --- a/onchain/rollups/export/artifacts/contracts/common/OutputEncoding.sol/OutputEncoding.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "contractName": "OutputEncoding", - "sourceName": "contracts/common/OutputEncoding.sol", - "abi": [], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220cbe9d20648f9b42b2d1cf1ad905d232b346d1bf5c19dc2ed14347d8f4d1b0cd864736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220cbe9d20648f9b42b2d1cf1ad905d232b346d1bf5c19dc2ed14347d8f4d1b0cd864736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "title": "Output Encoding Library", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Defines the encoding of outputs generated by the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "encodeNotice(bytes calldata)": "infinite", - "encodeVoucher(address,bytes calldata)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/consensus/AbstractConsensus.sol/AbstractConsensus.json b/onchain/rollups/export/artifacts/contracts/consensus/AbstractConsensus.sol/AbstractConsensus.json deleted file mode 100644 index 0d460024f..000000000 --- a/onchain/rollups/export/artifacts/contracts/consensus/AbstractConsensus.sol/AbstractConsensus.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "contractName": "AbstractConsensus", - "sourceName": "contracts/consensus/AbstractConsensus.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "epochHash_", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "firstInputIndex_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastInputIndex_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - } - }, - "kind": "dev", - "methods": { - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "epochHash_": "The claimed epoch hash", - "firstInputIndex_": "The index of the first input of the epoch in the input box", - "lastInputIndex_": "The index of the last input of the epoch in the input box" - } - } - }, - "title": "Abstract Consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - } - }, - "kind": "user", - "methods": { - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. The encoding of `_proofContext` might vary depending on the implementation." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - } - }, - "notice": "An abstract contract that partially implements `IConsensus`.", - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "getClaim(address,bytes)": "d79a8240", - "join()": "b688a363" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/consensus/IConsensus.sol/IConsensus.json b/onchain/rollups/export/artifacts/contracts/consensus/IConsensus.sol/IConsensus.json deleted file mode 100644 index cc1f83e25..000000000 --- a/onchain/rollups/export/artifacts/contracts/consensus/IConsensus.sol/IConsensus.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "contractName": "IConsensus", - "sourceName": "contracts/consensus/IConsensus.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "epochHash_", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "firstInputIndex_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastInputIndex_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - } - }, - "kind": "dev", - "methods": { - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "epochHash_": "The claimed epoch hash", - "firstInputIndex_": "The index of the first input of the epoch in the input box", - "lastInputIndex_": "The index of the last input of the epoch in the input box" - } - }, - "join()": { - "details": "MUST fire an `ApplicationJoined` event with the message sender as argument." - } - }, - "title": "Consensus interface", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - } - }, - "kind": "user", - "methods": { - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. The encoding of `_proofContext` might vary depending on the implementation." - }, - "join()": { - "notice": "Signal the consensus that the message sender wants to join its validation set." - } - }, - "notice": "This contract defines a generic interface for consensuses. We use the word \"consensus\" to designate a contract that provides claims in the base layer regarding the state of off-chain machines running in the execution layer. How this contract is able to reach consensus, who is able to submit claims, and how are claims stored in the base layer are some of the implementation details left unspecified by this interface. From the point of view of a DApp, these claims are necessary to validate on-chain action allowed by the off-chain machine in the form of vouchers and notices. Each claim is composed of three parts: an epoch hash, a first index, and a last index. We'll explain each of these parts below. First, let us define the word \"epoch\". For finality reasons, we need to divide the stream of inputs being fed into the off-chain machine into batches of inputs, which we call \"epoches\". At the end of every epoch, we summarize the state of the off-chain machine in a single hash, called \"epoch hash\". Please note that this interface does not define how this stream of inputs is being chopped up into epoches. The other two parts are simply the indices of the first and last inputs accepted during the epoch. Logically, the first index MUST BE less than or equal to the last index. As a result, every epoch MUST accept at least one input. This assumption stems from the fact that the state of a machine can only change after an input is fed into it. Examples of possible implementations of this interface include: * An authority consensus, controlled by a single address who has full control over epoch boundaries, claim submission, asset management, etc. * A quorum consensus, controlled by a limited set of validators, that vote on the state of the machine at the end of every epoch. Also, epoch boundaries are determined by the timestamp in the base layer, and assets are split equally amongst the validators. * An NxN consensus, which allows anyone to submit and dispute claims in the base layer. Epoch boundaries are determined in the same fashion as in the quorum example.", - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "getClaim(address,bytes)": "d79a8240", - "join()": "b688a363" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/consensus/authority/Authority.sol/Authority.json b/onchain/rollups/export/artifacts/contracts/consensus/authority/Authority.sol/Authority.json deleted file mode 100644 index a26d79972..000000000 --- a/onchain/rollups/export/artifacts/contracts/consensus/authority/Authority.sol/Authority.json +++ /dev/null @@ -1,382 +0,0 @@ -{ - "contractName": "Authority", - "sourceName": "contracts/consensus/authority/Authority.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AuthorityWithdrawalFailed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b5060405161096538038061096583398101604081905261002f91610181565b61003833610057565b336001600160a01b0382161461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b6107a5806101c06000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b1366004610567565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f8366004610567565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b661012436600461058b565b61028c565b61013c610137366004610615565b610331565b604080519384526020840192909252908201526060016100e1565b6100b661016536600461066a565b6103ba565b6100b6610178366004610567565b61042a565b6101856104a8565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104a8565b6101eb6000610502565b565b6101f56104a8565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104a8565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390526000919085169063a9059cbb906044016020604051808303816000875af11580156102e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030b91906106ac565b90508061032b5760405163099e1ca760e11b815260040160405180910390fd5b50505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a82409061036a908990899089906004016106f7565b606060405180830381865afa158015610387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ab9190610725565b92509250925093509350939050565b6103c26104a8565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb0906103f49085908590600401610753565b600060405180830381600087803b15801561040e57600080fd5b505af1158015610422573d6000803e3d6000fd5b505050505050565b6104326104a8565b6001600160a01b03811661049c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6104a581610502565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610493565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104a557600080fd5b60006020828403121561057957600080fd5b813561058481610552565b9392505050565b6000806000606084860312156105a057600080fd5b83356105ab81610552565b925060208401356105bb81610552565b929592945050506040919091013590565b60008083601f8401126105de57600080fd5b50813567ffffffffffffffff8111156105f657600080fd5b60208301915083602082850101111561060e57600080fd5b9250929050565b60008060006040848603121561062a57600080fd5b833561063581610552565b9250602084013567ffffffffffffffff81111561065157600080fd5b61065d868287016105cc565b9497909650939450505050565b6000806020838503121561067d57600080fd5b823567ffffffffffffffff81111561069457600080fd5b6106a0858286016105cc565b90969095509350505050565b6000602082840312156106be57600080fd5b8151801515811461058457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061071c90830184866106ce565b95945050505050565b60008060006060848603121561073a57600080fd5b8351925060208401519150604084015190509250925092565b6020815260006107676020830184866106ce565b94935050505056fea26469706673582212203e1550d4f8e23681fe9c5affb345c0148a95be77552a416607ca97fb01f6354c64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b1366004610567565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f8366004610567565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b661012436600461058b565b61028c565b61013c610137366004610615565b610331565b604080519384526020840192909252908201526060016100e1565b6100b661016536600461066a565b6103ba565b6100b6610178366004610567565b61042a565b6101856104a8565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104a8565b6101eb6000610502565b565b6101f56104a8565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104a8565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390526000919085169063a9059cbb906044016020604051808303816000875af11580156102e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030b91906106ac565b90508061032b5760405163099e1ca760e11b815260040160405180910390fd5b50505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a82409061036a908990899089906004016106f7565b606060405180830381865afa158015610387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ab9190610725565b92509250925093509350939050565b6103c26104a8565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb0906103f49085908590600401610753565b600060405180830381600087803b15801561040e57600080fd5b505af1158015610422573d6000803e3d6000fd5b505050505050565b6104326104a8565b6001600160a01b03811661049c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6104a581610502565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610493565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104a557600080fd5b60006020828403121561057957600080fd5b813561058481610552565b9392505050565b6000806000606084860312156105a057600080fd5b83356105ab81610552565b925060208401356105bb81610552565b929592945050506040919091013590565b60008083601f8401126105de57600080fd5b50813567ffffffffffffffff8111156105f657600080fd5b60208301915083602082850101111561060e57600080fd5b9250929050565b60008060006040848603121561062a57600080fd5b833561063581610552565b9250602084013567ffffffffffffffff81111561065157600080fd5b61065d868287016105cc565b9497909650939450505050565b6000806020838503121561067d57600080fd5b823567ffffffffffffffff81111561069457600080fd5b6106a0858286016105cc565b90969095509350505050565b6000602082840312156106be57600080fd5b8151801515811461058457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061071c90830184866106ce565b95945050505050565b60008060006060848603121561073a57600080fd5b8351925060208401519150604084015190509250925092565b6020815260006107676020830184866106ce565b94935050505056fea26469706673582212203e1550d4f8e23681fe9c5affb345c0148a95be77552a416607ca97fb01f6354c64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "errors": { - "AuthorityWithdrawalFailed()": [ - { - "notice": "Raised when a transfer of tokens from an authority to a recipient fails." - } - ] - }, - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "391400", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "getClaim(address,bytes)": "infinite", - "getHistory()": "2409", - "join()": "1200", - "migrateHistoryToConsensus(address)": "infinite", - "owner()": "2354", - "renounceOwnership()": "infinite", - "setHistory(address)": "27783", - "submitClaim(bytes)": "infinite", - "transferOwnership(address)": "infinite", - "withdrawERC20Tokens(address,address,uint256)": "infinite" - } - }, - "methodIdentifiers": { - "getClaim(address,bytes)": "d79a8240", - "getHistory()": "aa15efc8", - "join()": "b688a363", - "migrateHistoryToConsensus(address)": "9368a3d3", - "owner()": "8da5cb5b", - "renounceOwnership()": "715018a6", - "setHistory(address)": "159c5ea1", - "submitClaim(bytes)": "ddfdfbb0", - "transferOwnership(address)": "f2fde38b", - "withdrawERC20Tokens(address,address,uint256)": "bcdd1e13" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/dapp/CartesiDApp.sol/CartesiDApp.json b/onchain/rollups/export/artifacts/contracts/dapp/CartesiDApp.sol/CartesiDApp.json deleted file mode 100644 index cedc3d588..000000000 --- a/onchain/rollups/export/artifacts/contracts/dapp/CartesiDApp.sol/CartesiDApp.json +++ /dev/null @@ -1,806 +0,0 @@ -{ - "contractName": "CartesiDApp", - "sourceName": "contracts/dapp/CartesiDApp.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EtherTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectEpochHash", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectOutputHashesRootHash", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectOutputsEpochRootHash", - "type": "error" - }, - { - "inputs": [], - "name": "InputIndexOutOfClaimBounds", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyDApp", - "type": "error" - }, - { - "inputs": [], - "name": "VoucherReexecutionNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IConsensus", - "name": "newConsensus", - "type": "address" - } - ], - "name": "NewConsensus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "voucherId", - "type": "uint256" - } - ], - "name": "VoucherExecuted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_destination", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint64", - "name": "inputIndexWithinEpoch", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "outputIndexWithinInput", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "outputHashesRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "vouchersEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "noticesEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "machineStateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "outputHashInOutputHashesSiblings", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "outputHashesInEpochSiblings", - "type": "bytes32[]" - } - ], - "internalType": "struct OutputValidityProof", - "name": "validity", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "context", - "type": "bytes" - } - ], - "internalType": "struct Proof", - "name": "_proof", - "type": "tuple" - } - ], - "name": "executeVoucher", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getConsensus", - "outputs": [ - { - "internalType": "contract IConsensus", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTemplateHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_newConsensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_notice", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint64", - "name": "inputIndexWithinEpoch", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "outputIndexWithinInput", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "outputHashesRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "vouchersEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "noticesEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "machineStateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "outputHashInOutputHashesSiblings", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "outputHashesInEpochSiblings", - "type": "bytes32[]" - } - ], - "internalType": "struct OutputValidityProof", - "name": "validity", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "context", - "type": "bytes" - } - ], - "internalType": "struct Proof", - "name": "_proof", - "type": "tuple" - } - ], - "name": "validateNotice", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inboxInputIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_outputIndexWithinInput", - "type": "uint256" - } - ], - "name": "wasVoucherExecuted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "withdrawEther", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bytecode": "0x60a06040523480156200001157600080fd5b506040516200171038038062001710833981016040819052620000349162000212565b6200003f33620000cb565b600180556200004e826200011b565b6080819052600380546001600160a01b0319166001600160a01b0385169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b158015620000a957600080fd5b505af1158015620000be573d6000803e3d6000fd5b505050505050506200025a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001256200019e565b6001600160a01b038116620001905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200019b81620000cb565b50565b6000546001600160a01b03163314620001fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000187565b565b6001600160a01b03811681146200019b57600080fd5b6000806000606084860312156200022857600080fd5b83516200023581620001fc565b60208501519093506200024881620001fc565b80925050604084015190509250925092565b60805161149a6200027660003960006101ec015261149a6000f3fe6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063bc197c8111610059578063bc197c8114610288578063f23a6e61146102b4578063f2fde38b146102e0578063fc4116831461030057600080fd5b80638da5cb5b1461022a57806396487d46146102485780639d9b11451461026857600080fd5b8063179e740b116100bb578063179e740b14610186578063522f6815146101b857806361b12c66146101da578063715018a61461021557600080fd5b806301ffc9a7146100ed5780631250482f14610122578063150b7a021461014257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004610d2a565b610320565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061010d61013d366004610dd0565b610357565b34801561014e57600080fd5b5061016d61015d366004610f00565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610119565b34801561019257600080fd5b506003546001600160a01b03165b6040516001600160a01b039091168152602001610119565b3480156101c457600080fd5b506101d86101d3366004610f5f565b61053c565b005b3480156101e657600080fd5b506040517f00000000000000000000000000000000000000000000000000000000000000008152602001610119565b34801561022157600080fd5b506101d86105d5565b34801561023657600080fd5b506000546001600160a01b03166101a0565b34801561025457600080fd5b5061010d610263366004610f8b565b6105e9565b34801561027457600080fd5b5061010d610283366004610ff3565b61063a565b34801561029457600080fd5b5061016d6102a3366004611094565b63bc197c8160e01b95945050505050565b3480156102c057600080fd5b5061016d6102cf366004611141565b63f23a6e6160e01b95945050505050565b3480156102ec57600080fd5b506101d86102fb3660046111a9565b61064c565b34801561030c57600080fd5b506101d861031b3660046111a9565b6106ca565b60006001600160e01b03198216630271189760e51b148061035157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061036161077f565b600080808061037b61037660208801886111c6565b6107d8565b919550935091506103988383610391898061120c565b919061085f565b90506103b4898989876103ab8b8061120c565b939291906108a5565b60006103e86103c3888061120c565b6103d490604081019060200161122c565b6001600160401b03168360809190911b1790565b90506103f3816108da565b15610411576040516370de22b760e01b815260040160405180910390fd5b60008a6001600160a01b03168a8a60405161042d929190611255565b6000604051808303816000865af19150503d806000811461046a576040519150601f19603f3d011682016040523d82523d6000602084013e61046f565b606091505b505090508015610524576040516306449da160e41b815260026004820152602481018390526001604482015273__$f57eb21c11c6dae369da3ca36f4f48eb77$__90636449da109060640160006040518083038186803b1580156104d257600080fd5b505af41580156104e6573d6000803e3d6000fd5b505050507f0eb7ee080f865f1cadc4f54daf58cc3b8879e888832867d13351edcec0fbdc548260405161051b91815260200190565b60405180910390a15b9550505050505061053460018055565b949350505050565b33301461055c5760405163a08d601d60e01b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105a9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ae565b606091505b50509050806105d057604051630ce8f45160e31b815260040160405180910390fd5b505050565b6105dd610958565b6105e760006109b2565b565b60008080806105fe61037660208701876111c6565b919450925090506106148282610391888061120c565b5061062d878785610625898061120c565b929190610a02565b5060019695505050505050565b6000608082901b8317610534816108da565b610654610958565b6001600160a01b0381166106be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6106c7816109b2565b50565b6106d2610958565b600380546001600160a01b0319166001600160a01b0383169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b50506040516001600160a01b03841681527f4991c6f37185659e276ff918a96f3e20e6c5abcd8c9aab450dc19c2f7ad35cb59250602001905060405180910390a150565b6002600154036107d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106b5565b6002600155565b60035460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906108119030908990899060040161128e565b606060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085291906112bc565b9250925092509250925092565b60008061086f602086018661122c565b610882906001600160401b0316856112ea565b9050828111156105345760405163fd9ae91f60e01b815260040160405180910390fd5b60006108b2858585610a29565b90506108d2868284606083013560255b6001600160401b03166015610a58565b505050505050565b6040516303fbaf7360e01b8152600260048201526024810182905260009073__$f57eb21c11c6dae369da3ca36f4f48eb77$__906303fbaf7390604401602060405180830381865af4158015610934573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610351919061130b565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610a0e8484610cfe565b9050610a22858284608083013560256108c2565b5050505050565b6060838383604051602001610a409392919061128e565b60405160208183030381529060405290509392505050565b6040805160608089013560208301526080808a01359383019390935260a0890135908201528591016040516020818303038152906040528051906020012014610ab457604051636fbd3b7160e11b815260040160405180910390fd5b8273__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610af0610adf60208b018b61122c565b60051b681fffffffffffffffe01690565b60058660408c0135610b0560e08e018e61132d565b6040518763ffffffff1660e01b8152600401610b2696959493929190611376565b602060405180830381865af4158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6791906113d9565b14610b8557604051634371daa160e11b815260040160405180910390fd5b600073__$2a7ef22e717e9afc55afc95d018bf1a85b$__63c84583a18780519060200120604051602001610bbb91815260200190565b60408051601f19818403018152908290526001600160e01b031960e084901b168252610bec916005906004016113f2565b602060405180830381865af4158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906113d9565b9050866040013573__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610c648a6020016020810190610adf919061122c565b60058686610c7560c08f018f61132d565b6040518763ffffffff1660e01b8152600401610c9696959493929190611376565b602060405180830381865af4158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd791906113d9565b14610cf55760405163017c689560e61b815260040160405180910390fd5b50505050505050565b60608282604051602001610d13929190611450565b604051602081830303815290604052905092915050565b600060208284031215610d3c57600080fd5b81356001600160e01b031981168114610d5457600080fd5b9392505050565b6001600160a01b03811681146106c757600080fd5b60008083601f840112610d8257600080fd5b5081356001600160401b03811115610d9957600080fd5b602083019150836020828501011115610db157600080fd5b9250929050565b600060408284031215610dca57600080fd5b50919050565b60008060008060608587031215610de657600080fd5b8435610df181610d5b565b935060208501356001600160401b0380821115610e0d57600080fd5b610e1988838901610d70565b90955093506040870135915080821115610e3257600080fd5b50610e3f87828801610db8565b91505092959194509250565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610e8957610e89610e4b565b604052919050565b600082601f830112610ea257600080fd5b81356001600160401b03811115610ebb57610ebb610e4b565b610ece601f8201601f1916602001610e61565b818152846020838601011115610ee357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610f1657600080fd5b8435610f2181610d5b565b93506020850135610f3181610d5b565b92506040850135915060608501356001600160401b03811115610f5357600080fd5b610e3f87828801610e91565b60008060408385031215610f7257600080fd5b8235610f7d81610d5b565b946020939093013593505050565b600080600060408486031215610fa057600080fd5b83356001600160401b0380821115610fb757600080fd5b610fc387838801610d70565b90955093506020860135915080821115610fdc57600080fd5b50610fe986828701610db8565b9150509250925092565b6000806040838503121561100657600080fd5b50508035926020909101359150565b600082601f83011261102657600080fd5b813560206001600160401b0382111561104157611041610e4b565b8160051b611050828201610e61565b928352848101820192828101908785111561106a57600080fd5b83870192505b8483101561108957823582529183019190830190611070565b979650505050505050565b600080600080600060a086880312156110ac57600080fd5b85356110b781610d5b565b945060208601356110c781610d5b565b935060408601356001600160401b03808211156110e357600080fd5b6110ef89838a01611015565b9450606088013591508082111561110557600080fd5b61111189838a01611015565b9350608088013591508082111561112757600080fd5b5061113488828901610e91565b9150509295509295909350565b600080600080600060a0868803121561115957600080fd5b853561116481610d5b565b9450602086013561117481610d5b565b9350604086013592506060860135915060808601356001600160401b0381111561119d57600080fd5b61113488828901610e91565b6000602082840312156111bb57600080fd5b8135610d5481610d5b565b6000808335601e198436030181126111dd57600080fd5b8301803591506001600160401b038211156111f757600080fd5b602001915036819003821315610db157600080fd5b6000823560fe1983360301811261122257600080fd5b9190910192915050565b60006020828403121561123e57600080fd5b81356001600160401b0381168114610d5457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03841681526040602082018190526000906112b39083018486611265565b95945050505050565b6000806000606084860312156112d157600080fd5b8351925060208401519150604084015190509250925092565b8082018082111561035157634e487b7160e01b600052601160045260246000fd5b60006020828403121561131d57600080fd5b81518015158114610d5457600080fd5b6000808335601e1984360301811261134457600080fd5b8301803591506001600160401b0382111561135e57600080fd5b6020019150600581901b3603821315610db157600080fd5b6001600160401b03878116825286166020820152604081018590526060810184905260a060808201819052810182905260006001600160fb1b038311156113bc57600080fd5b8260051b808560c08501379190910160c001979650505050505050565b6000602082840312156113eb57600080fd5b5051919050565b604081526000835180604084015260005b818110156114205760208187018101516060868401015201611403565b506000606082850101526060601f19601f8301168401019150506001600160401b03831660208301529392505050565b60208152600061053460208301848661126556fea2646970667358221220c2f18f0c0761c62c649b63b6451f634e09c9561c6ebd2cc4dbbf503a1f564d2564736f6c63430008130033", - "deployedBytecode": "0x6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063bc197c8111610059578063bc197c8114610288578063f23a6e61146102b4578063f2fde38b146102e0578063fc4116831461030057600080fd5b80638da5cb5b1461022a57806396487d46146102485780639d9b11451461026857600080fd5b8063179e740b116100bb578063179e740b14610186578063522f6815146101b857806361b12c66146101da578063715018a61461021557600080fd5b806301ffc9a7146100ed5780631250482f14610122578063150b7a021461014257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004610d2a565b610320565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061010d61013d366004610dd0565b610357565b34801561014e57600080fd5b5061016d61015d366004610f00565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610119565b34801561019257600080fd5b506003546001600160a01b03165b6040516001600160a01b039091168152602001610119565b3480156101c457600080fd5b506101d86101d3366004610f5f565b61053c565b005b3480156101e657600080fd5b506040517f00000000000000000000000000000000000000000000000000000000000000008152602001610119565b34801561022157600080fd5b506101d86105d5565b34801561023657600080fd5b506000546001600160a01b03166101a0565b34801561025457600080fd5b5061010d610263366004610f8b565b6105e9565b34801561027457600080fd5b5061010d610283366004610ff3565b61063a565b34801561029457600080fd5b5061016d6102a3366004611094565b63bc197c8160e01b95945050505050565b3480156102c057600080fd5b5061016d6102cf366004611141565b63f23a6e6160e01b95945050505050565b3480156102ec57600080fd5b506101d86102fb3660046111a9565b61064c565b34801561030c57600080fd5b506101d861031b3660046111a9565b6106ca565b60006001600160e01b03198216630271189760e51b148061035157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061036161077f565b600080808061037b61037660208801886111c6565b6107d8565b919550935091506103988383610391898061120c565b919061085f565b90506103b4898989876103ab8b8061120c565b939291906108a5565b60006103e86103c3888061120c565b6103d490604081019060200161122c565b6001600160401b03168360809190911b1790565b90506103f3816108da565b15610411576040516370de22b760e01b815260040160405180910390fd5b60008a6001600160a01b03168a8a60405161042d929190611255565b6000604051808303816000865af19150503d806000811461046a576040519150601f19603f3d011682016040523d82523d6000602084013e61046f565b606091505b505090508015610524576040516306449da160e41b815260026004820152602481018390526001604482015273__$f57eb21c11c6dae369da3ca36f4f48eb77$__90636449da109060640160006040518083038186803b1580156104d257600080fd5b505af41580156104e6573d6000803e3d6000fd5b505050507f0eb7ee080f865f1cadc4f54daf58cc3b8879e888832867d13351edcec0fbdc548260405161051b91815260200190565b60405180910390a15b9550505050505061053460018055565b949350505050565b33301461055c5760405163a08d601d60e01b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105a9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ae565b606091505b50509050806105d057604051630ce8f45160e31b815260040160405180910390fd5b505050565b6105dd610958565b6105e760006109b2565b565b60008080806105fe61037660208701876111c6565b919450925090506106148282610391888061120c565b5061062d878785610625898061120c565b929190610a02565b5060019695505050505050565b6000608082901b8317610534816108da565b610654610958565b6001600160a01b0381166106be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6106c7816109b2565b50565b6106d2610958565b600380546001600160a01b0319166001600160a01b0383169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b50506040516001600160a01b03841681527f4991c6f37185659e276ff918a96f3e20e6c5abcd8c9aab450dc19c2f7ad35cb59250602001905060405180910390a150565b6002600154036107d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106b5565b6002600155565b60035460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906108119030908990899060040161128e565b606060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085291906112bc565b9250925092509250925092565b60008061086f602086018661122c565b610882906001600160401b0316856112ea565b9050828111156105345760405163fd9ae91f60e01b815260040160405180910390fd5b60006108b2858585610a29565b90506108d2868284606083013560255b6001600160401b03166015610a58565b505050505050565b6040516303fbaf7360e01b8152600260048201526024810182905260009073__$f57eb21c11c6dae369da3ca36f4f48eb77$__906303fbaf7390604401602060405180830381865af4158015610934573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610351919061130b565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610a0e8484610cfe565b9050610a22858284608083013560256108c2565b5050505050565b6060838383604051602001610a409392919061128e565b60405160208183030381529060405290509392505050565b6040805160608089013560208301526080808a01359383019390935260a0890135908201528591016040516020818303038152906040528051906020012014610ab457604051636fbd3b7160e11b815260040160405180910390fd5b8273__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610af0610adf60208b018b61122c565b60051b681fffffffffffffffe01690565b60058660408c0135610b0560e08e018e61132d565b6040518763ffffffff1660e01b8152600401610b2696959493929190611376565b602060405180830381865af4158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6791906113d9565b14610b8557604051634371daa160e11b815260040160405180910390fd5b600073__$2a7ef22e717e9afc55afc95d018bf1a85b$__63c84583a18780519060200120604051602001610bbb91815260200190565b60408051601f19818403018152908290526001600160e01b031960e084901b168252610bec916005906004016113f2565b602060405180830381865af4158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906113d9565b9050866040013573__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610c648a6020016020810190610adf919061122c565b60058686610c7560c08f018f61132d565b6040518763ffffffff1660e01b8152600401610c9696959493929190611376565b602060405180830381865af4158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd791906113d9565b14610cf55760405163017c689560e61b815260040160405180910390fd5b50505050505050565b60608282604051602001610d13929190611450565b604051602081830303815290604052905092915050565b600060208284031215610d3c57600080fd5b81356001600160e01b031981168114610d5457600080fd5b9392505050565b6001600160a01b03811681146106c757600080fd5b60008083601f840112610d8257600080fd5b5081356001600160401b03811115610d9957600080fd5b602083019150836020828501011115610db157600080fd5b9250929050565b600060408284031215610dca57600080fd5b50919050565b60008060008060608587031215610de657600080fd5b8435610df181610d5b565b935060208501356001600160401b0380821115610e0d57600080fd5b610e1988838901610d70565b90955093506040870135915080821115610e3257600080fd5b50610e3f87828801610db8565b91505092959194509250565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610e8957610e89610e4b565b604052919050565b600082601f830112610ea257600080fd5b81356001600160401b03811115610ebb57610ebb610e4b565b610ece601f8201601f1916602001610e61565b818152846020838601011115610ee357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610f1657600080fd5b8435610f2181610d5b565b93506020850135610f3181610d5b565b92506040850135915060608501356001600160401b03811115610f5357600080fd5b610e3f87828801610e91565b60008060408385031215610f7257600080fd5b8235610f7d81610d5b565b946020939093013593505050565b600080600060408486031215610fa057600080fd5b83356001600160401b0380821115610fb757600080fd5b610fc387838801610d70565b90955093506020860135915080821115610fdc57600080fd5b50610fe986828701610db8565b9150509250925092565b6000806040838503121561100657600080fd5b50508035926020909101359150565b600082601f83011261102657600080fd5b813560206001600160401b0382111561104157611041610e4b565b8160051b611050828201610e61565b928352848101820192828101908785111561106a57600080fd5b83870192505b8483101561108957823582529183019190830190611070565b979650505050505050565b600080600080600060a086880312156110ac57600080fd5b85356110b781610d5b565b945060208601356110c781610d5b565b935060408601356001600160401b03808211156110e357600080fd5b6110ef89838a01611015565b9450606088013591508082111561110557600080fd5b61111189838a01611015565b9350608088013591508082111561112757600080fd5b5061113488828901610e91565b9150509295509295909350565b600080600080600060a0868803121561115957600080fd5b853561116481610d5b565b9450602086013561117481610d5b565b9350604086013592506060860135915060808601356001600160401b0381111561119d57600080fd5b61113488828901610e91565b6000602082840312156111bb57600080fd5b8135610d5481610d5b565b6000808335601e198436030181126111dd57600080fd5b8301803591506001600160401b038211156111f757600080fd5b602001915036819003821315610db157600080fd5b6000823560fe1983360301811261122257600080fd5b9190910192915050565b60006020828403121561123e57600080fd5b81356001600160401b0381168114610d5457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03841681526040602082018190526000906112b39083018486611265565b95945050505050565b6000806000606084860312156112d157600080fd5b8351925060208401519150604084015190509250925092565b8082018082111561035157634e487b7160e01b600052601160045260246000fd5b60006020828403121561131d57600080fd5b81518015158114610d5457600080fd5b6000808335601e1984360301811261134457600080fd5b8301803591506001600160401b0382111561135e57600080fd5b6020019150600581901b3603821315610db157600080fd5b6001600160401b03878116825286166020820152604081018590526060810184905260a060808201819052810182905260006001600160fb1b038311156113bc57600080fd5b8260051b808560c08501379190910160c001979650505050505050565b6000602082840312156113eb57600080fd5b5051919050565b604081526000835180604084015260005b818110156114205760208187018101516060868401015201611403565b506000606082850101526060601f19601f8301168401019150506001600160401b03831660208301529392505050565b60208152600061053460208301848661126556fea2646970667358221220c2f18f0c0761c62c649b63b6451f634e09c9561c6ebd2cc4dbbf503a1f564d2564736f6c63430008130033", - "linkReferences": { - "@cartesi/util/contracts/Bitmask.sol": { - "Bitmask": [ - { - "length": 20, - "start": 1811 - }, - { - "length": 20, - "start": 2928 - } - ] - }, - "@cartesi/util/contracts/MerkleV2.sol": { - "MerkleV2": [ - { - "length": 20, - "start": 3373 - }, - { - "length": 20, - "start": 3583 - }, - { - "length": 20, - "start": 3756 - } - ] - } - }, - "deployedLinkReferences": { - "@cartesi/util/contracts/Bitmask.sol": { - "Bitmask": [ - { - "length": 20, - "start": 1181 - }, - { - "length": 20, - "start": 2298 - } - ] - }, - "@cartesi/util/contracts/MerkleV2.sol": { - "MerkleV2": [ - { - "length": 20, - "start": 2743 - }, - { - "length": 20, - "start": 2953 - }, - { - "length": 20, - "start": 3126 - } - ] - } - }, - "devdoc": { - "events": { - "NewConsensus(address)": { - "details": "MUST be triggered on a successful call to `migrateToConsensus`.", - "params": { - "newConsensus": "The new consensus contract" - } - }, - "VoucherExecuted(uint256)": { - "params": { - "voucherId": "A number that uniquely identifies the voucher amongst all vouchers emitted by this DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Calls the `join` function on `_consensus`.", - "params": { - "_consensus": "The initial consensus contract", - "_owner": "The initial DApp owner", - "_templateHash": "The initial machine state hash" - } - }, - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "details": "On a successful execution, emits a `VoucherExecuted` event. Execution of already executed voucher will raise a `VoucherReexecutionNotAllowed` error.", - "params": { - "_destination": "The address that will receive the payload through a message call", - "_payload": "The payload, which—in the case of Solidity contracts—encodes a function call", - "_proof": "The proof used to validate the voucher against a claim submitted by the current consensus contract" - }, - "returns": { - "_0": "Whether the execution was successful or not" - } - }, - "getConsensus()": { - "returns": { - "_0": "The current consensus" - } - }, - "getTemplateHash()": { - "returns": { - "_0": "The DApp's template hash" - } - }, - "migrateToConsensus(address)": { - "details": "Can only be called by the DApp owner.", - "params": { - "_newConsensus": "The new consensus" - } - }, - "onERC721Received(address,address,uint256,bytes)": { - "details": "See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`." - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "supportsInterface(bytes4)": { - "details": "See {IERC165-supportsInterface}." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "params": { - "_notice": "The notice", - "_proof": "Data for validating outputs" - }, - "returns": { - "_0": "Whether the notice is valid or not" - } - }, - "wasVoucherExecuted(uint256,uint256)": { - "params": { - "_inboxInputIndex": "The index of the input in the input box", - "_outputIndexWithinInput": "The index of output emitted by the input" - }, - "returns": { - "_0": "Whether the voucher has been executed before" - } - }, - "withdrawEther(address,uint256)": { - "details": "This function can only be called by the DApp itself through vouchers. If this method is not called by DApp itself, `OnlyDApp` error is raised. If the transfer fails, `EtherTransferFailed` error is raised.", - "params": { - "_receiver": "The address which will receive the amount of Ether", - "_value": "The amount of Ether to be transferred in Wei" - } - } - }, - "stateVariables": { - "consensus": { - "details": "See the `getConsensus` and `migrateToConsensus` functions." - }, - "templateHash": { - "details": "See the `getTemplateHash` function." - }, - "voucherBitmask": { - "details": "See the `wasVoucherExecuted` function." - } - }, - "title": "Cartesi DApp", - "version": 1 - }, - "userdoc": { - "errors": { - "EtherTransferFailed()": [ - { - "notice": "Raised when the transfer fails." - } - ], - "IncorrectEpochHash()": [ - { - "notice": "Raised when some `OutputValidityProof` variables does not match the presented finalized epoch." - } - ], - "IncorrectOutputHashesRootHash()": [ - { - "notice": "Raised when Merkle root of output hash is NOT contained in the output metadata array memory range." - } - ], - "IncorrectOutputsEpochRootHash()": [ - { - "notice": "Raised when `OutputValidityProof` metadata memory range is NOT contained in epoch's output memory range." - } - ], - "InputIndexOutOfClaimBounds()": [ - { - "notice": "Raised when epoch input index is NOT compatible with the provided input index range." - } - ], - "OnlyDApp()": [ - { - "notice": "Raised when a mehtod is not called by DApp itself." - } - ], - "VoucherReexecutionNotAllowed()": [ - { - "notice": "Raised when executing an already executed voucher." - } - ] - }, - "events": { - "NewConsensus(address)": { - "notice": "The DApp has migrated to another consensus contract." - }, - "VoucherExecuted(uint256)": { - "notice": "A voucher was executed from the DApp." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `CartesiDApp` contract." - }, - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "notice": "Try to execute a voucher. Reverts if voucher was already successfully executed." - }, - "getConsensus()": { - "notice": "Get the current consensus." - }, - "getTemplateHash()": { - "notice": "Get the DApp's template hash." - }, - "migrateToConsensus(address)": { - "notice": "Migrate the DApp to a new consensus." - }, - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "notice": "Validate a notice." - }, - "wasVoucherExecuted(uint256,uint256)": { - "notice": "Check whether a voucher has been executed." - }, - "withdrawEther(address,uint256)": { - "notice": "Transfer some amount of Ether to some recipient." - } - }, - "notice": "This contract acts as the base layer incarnation of a DApp running on the execution layer. The DApp is hereby able to interact with other smart contracts through the execution of vouchers and the validation of notices. These outputs are generated by the DApp backend on the execution layer and can be proven in the base layer thanks to claims submitted by a consensus contract. A voucher is a one-time message call to another contract. It can encode asset transfers, approvals, or any other message call that doesn't require Ether to be sent along. A voucher will only be consumed if the underlying message call succeeds (that is, it doesn't revert). Furthermore, the return data of the message call is discarded entirely. As a protective measure against reentrancy attacks, nested voucher executions are prohibited. A notice, on the other hand, constitutes an arbitrary piece of data that can be proven any number of times. On their own, they do not trigger any type of contract-to-contract interaction. Rather, they merely serve to attest off-chain results, e.g. which player won a particular chess match. Every DApp is subscribed to a consensus contract, and governed by a single address, the owner. The consensus has the power of submitting claims, which, in turn, are used to validate vouchers and notices. Meanwhile, the owner has complete power over the DApp, as it can replace the consensus at any time. Therefore, the users of a DApp must trust both the consensus and the DApp owner. The DApp developer can choose whichever ownership and consensus models it wants. Examples of DApp ownership models include: * no owner (address zero) * individual signer (externally-owned account) * multiple signers (multi-sig) * DAO (decentralized autonomous organization) * self-owned DApp (off-chain governance logic) See `IConsensus` for examples of consensus models. This contract inherits the following OpenZeppelin contracts. For more information, please consult OpenZeppelin's official documentation. * `Ownable` * `ERC721Holder` * `ERC1155Holder` * `ReentrancyGuard`", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "1054800", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "infinite", - "getConsensus()": "2343", - "getTemplateHash()": "infinite", - "migrateToConsensus(address)": "infinite", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "infinite", - "onERC1155Received(address,address,uint256,uint256,bytes)": "infinite", - "onERC721Received(address,address,uint256,bytes)": "infinite", - "owner()": "2354", - "renounceOwnership()": "infinite", - "supportsInterface(bytes4)": "450", - "transferOwnership(address)": "infinite", - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "infinite", - "wasVoucherExecuted(uint256,uint256)": "infinite", - "withdrawEther(address,uint256)": "infinite" - }, - "internal": { - "_wasVoucherExecuted(uint256)": "infinite", - "getClaim(bytes calldata)": "infinite" - } - }, - "methodIdentifiers": { - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "1250482f", - "getConsensus()": "179e740b", - "getTemplateHash()": "61b12c66", - "migrateToConsensus(address)": "fc411683", - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": "bc197c81", - "onERC1155Received(address,address,uint256,uint256,bytes)": "f23a6e61", - "onERC721Received(address,address,uint256,bytes)": "150b7a02", - "owner()": "8da5cb5b", - "renounceOwnership()": "715018a6", - "supportsInterface(bytes4)": "01ffc9a7", - "transferOwnership(address)": "f2fde38b", - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "96487d46", - "wasVoucherExecuted(uint256,uint256)": "9d9b1145", - "withdrawEther(address,uint256)": "522f6815" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/dapp/CartesiDAppFactory.sol/CartesiDAppFactory.json b/onchain/rollups/export/artifacts/contracts/dapp/CartesiDAppFactory.sol/CartesiDAppFactory.json deleted file mode 100644 index e1f448e2f..000000000 --- a/onchain/rollups/export/artifacts/contracts/dapp/CartesiDAppFactory.sol/CartesiDAppFactory.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "contractName": "CartesiDAppFactory", - "sourceName": "contracts/dapp/CartesiDAppFactory.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract IConsensus", - "name": "consensus", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "dappOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "templateHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "contract CartesiDApp", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationCreated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "calculateApplicationAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "newApplication", - "outputs": [ - { - "internalType": "contract CartesiDApp", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - } - ], - "name": "newApplication", - "outputs": [ - { - "internalType": "contract CartesiDApp", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b50611af9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630e1a07f5146100465780633648bfb514610075578063bd4f121914610088575b600080fd5b6100596100543660046102df565b61009b565b6040516001600160a01b03909116815260200160405180910390f35b610059610083366004610325565b610148565b6100596100963660046102df565b6101ef565b600080828686866040516100ae906102ba565b6001600160a01b03938416815292909116602083015260408201526060018190604051809103906000f59050801580156100ec573d6000803e3d6000fd5b50604080516001600160a01b03888116825260208201889052838116828401529151929350908816917fe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd9181900360600190a295945050505050565b60008084848460405161015a906102ba565b6001600160a01b0393841681529290911660208301526040820152606001604051809103906000f080158015610194573d6000803e3d6000fd5b50604080516001600160a01b03878116825260208201879052838116828401529151929350908716917fe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd9181900360600190a2949350505050565b60006102738260405180602001610205906102ba565b601f1982820381018352601f9091011660408181526001600160a01b038a811660208401528916908201526060810187905260800160408051601f19818403018152908290526102589291602001610396565b6040516020818303038152906040528051906020012061027c565b95945050505050565b6000610289838330610290565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b611710806103b483390190565b6001600160a01b03811681146102dc57600080fd5b50565b600080600080608085870312156102f557600080fd5b8435610300816102c7565b93506020850135610310816102c7565b93969395505050506040820135916060013590565b60008060006060848603121561033a57600080fd5b8335610345816102c7565b92506020840135610355816102c7565b929592945050506040919091013590565b6000815160005b81811015610387576020818501810151868301520161036d565b50600093019283525090919050565b60006103ab6103a58386610366565b84610366565b94935050505056fe60a06040523480156200001157600080fd5b506040516200171038038062001710833981016040819052620000349162000212565b6200003f33620000cb565b600180556200004e826200011b565b6080819052600380546001600160a01b0319166001600160a01b0385169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b158015620000a957600080fd5b505af1158015620000be573d6000803e3d6000fd5b505050505050506200025a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001256200019e565b6001600160a01b038116620001905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200019b81620000cb565b50565b6000546001600160a01b03163314620001fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000187565b565b6001600160a01b03811681146200019b57600080fd5b6000806000606084860312156200022857600080fd5b83516200023581620001fc565b60208501519093506200024881620001fc565b80925050604084015190509250925092565b60805161149a6200027660003960006101ec015261149a6000f3fe6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063bc197c8111610059578063bc197c8114610288578063f23a6e61146102b4578063f2fde38b146102e0578063fc4116831461030057600080fd5b80638da5cb5b1461022a57806396487d46146102485780639d9b11451461026857600080fd5b8063179e740b116100bb578063179e740b14610186578063522f6815146101b857806361b12c66146101da578063715018a61461021557600080fd5b806301ffc9a7146100ed5780631250482f14610122578063150b7a021461014257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004610d2a565b610320565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061010d61013d366004610dd0565b610357565b34801561014e57600080fd5b5061016d61015d366004610f00565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610119565b34801561019257600080fd5b506003546001600160a01b03165b6040516001600160a01b039091168152602001610119565b3480156101c457600080fd5b506101d86101d3366004610f5f565b61053c565b005b3480156101e657600080fd5b506040517f00000000000000000000000000000000000000000000000000000000000000008152602001610119565b34801561022157600080fd5b506101d86105d5565b34801561023657600080fd5b506000546001600160a01b03166101a0565b34801561025457600080fd5b5061010d610263366004610f8b565b6105e9565b34801561027457600080fd5b5061010d610283366004610ff3565b61063a565b34801561029457600080fd5b5061016d6102a3366004611094565b63bc197c8160e01b95945050505050565b3480156102c057600080fd5b5061016d6102cf366004611141565b63f23a6e6160e01b95945050505050565b3480156102ec57600080fd5b506101d86102fb3660046111a9565b61064c565b34801561030c57600080fd5b506101d861031b3660046111a9565b6106ca565b60006001600160e01b03198216630271189760e51b148061035157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061036161077f565b600080808061037b61037660208801886111c6565b6107d8565b919550935091506103988383610391898061120c565b919061085f565b90506103b4898989876103ab8b8061120c565b939291906108a5565b60006103e86103c3888061120c565b6103d490604081019060200161122c565b6001600160401b03168360809190911b1790565b90506103f3816108da565b15610411576040516370de22b760e01b815260040160405180910390fd5b60008a6001600160a01b03168a8a60405161042d929190611255565b6000604051808303816000865af19150503d806000811461046a576040519150601f19603f3d011682016040523d82523d6000602084013e61046f565b606091505b505090508015610524576040516306449da160e41b815260026004820152602481018390526001604482015273__$f57eb21c11c6dae369da3ca36f4f48eb77$__90636449da109060640160006040518083038186803b1580156104d257600080fd5b505af41580156104e6573d6000803e3d6000fd5b505050507f0eb7ee080f865f1cadc4f54daf58cc3b8879e888832867d13351edcec0fbdc548260405161051b91815260200190565b60405180910390a15b9550505050505061053460018055565b949350505050565b33301461055c5760405163a08d601d60e01b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105a9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ae565b606091505b50509050806105d057604051630ce8f45160e31b815260040160405180910390fd5b505050565b6105dd610958565b6105e760006109b2565b565b60008080806105fe61037660208701876111c6565b919450925090506106148282610391888061120c565b5061062d878785610625898061120c565b929190610a02565b5060019695505050505050565b6000608082901b8317610534816108da565b610654610958565b6001600160a01b0381166106be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6106c7816109b2565b50565b6106d2610958565b600380546001600160a01b0319166001600160a01b0383169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b50506040516001600160a01b03841681527f4991c6f37185659e276ff918a96f3e20e6c5abcd8c9aab450dc19c2f7ad35cb59250602001905060405180910390a150565b6002600154036107d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106b5565b6002600155565b60035460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906108119030908990899060040161128e565b606060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085291906112bc565b9250925092509250925092565b60008061086f602086018661122c565b610882906001600160401b0316856112ea565b9050828111156105345760405163fd9ae91f60e01b815260040160405180910390fd5b60006108b2858585610a29565b90506108d2868284606083013560255b6001600160401b03166015610a58565b505050505050565b6040516303fbaf7360e01b8152600260048201526024810182905260009073__$f57eb21c11c6dae369da3ca36f4f48eb77$__906303fbaf7390604401602060405180830381865af4158015610934573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610351919061130b565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610a0e8484610cfe565b9050610a22858284608083013560256108c2565b5050505050565b6060838383604051602001610a409392919061128e565b60405160208183030381529060405290509392505050565b6040805160608089013560208301526080808a01359383019390935260a0890135908201528591016040516020818303038152906040528051906020012014610ab457604051636fbd3b7160e11b815260040160405180910390fd5b8273__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610af0610adf60208b018b61122c565b60051b681fffffffffffffffe01690565b60058660408c0135610b0560e08e018e61132d565b6040518763ffffffff1660e01b8152600401610b2696959493929190611376565b602060405180830381865af4158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6791906113d9565b14610b8557604051634371daa160e11b815260040160405180910390fd5b600073__$2a7ef22e717e9afc55afc95d018bf1a85b$__63c84583a18780519060200120604051602001610bbb91815260200190565b60408051601f19818403018152908290526001600160e01b031960e084901b168252610bec916005906004016113f2565b602060405180830381865af4158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906113d9565b9050866040013573__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610c648a6020016020810190610adf919061122c565b60058686610c7560c08f018f61132d565b6040518763ffffffff1660e01b8152600401610c9696959493929190611376565b602060405180830381865af4158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd791906113d9565b14610cf55760405163017c689560e61b815260040160405180910390fd5b50505050505050565b60608282604051602001610d13929190611450565b604051602081830303815290604052905092915050565b600060208284031215610d3c57600080fd5b81356001600160e01b031981168114610d5457600080fd5b9392505050565b6001600160a01b03811681146106c757600080fd5b60008083601f840112610d8257600080fd5b5081356001600160401b03811115610d9957600080fd5b602083019150836020828501011115610db157600080fd5b9250929050565b600060408284031215610dca57600080fd5b50919050565b60008060008060608587031215610de657600080fd5b8435610df181610d5b565b935060208501356001600160401b0380821115610e0d57600080fd5b610e1988838901610d70565b90955093506040870135915080821115610e3257600080fd5b50610e3f87828801610db8565b91505092959194509250565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610e8957610e89610e4b565b604052919050565b600082601f830112610ea257600080fd5b81356001600160401b03811115610ebb57610ebb610e4b565b610ece601f8201601f1916602001610e61565b818152846020838601011115610ee357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610f1657600080fd5b8435610f2181610d5b565b93506020850135610f3181610d5b565b92506040850135915060608501356001600160401b03811115610f5357600080fd5b610e3f87828801610e91565b60008060408385031215610f7257600080fd5b8235610f7d81610d5b565b946020939093013593505050565b600080600060408486031215610fa057600080fd5b83356001600160401b0380821115610fb757600080fd5b610fc387838801610d70565b90955093506020860135915080821115610fdc57600080fd5b50610fe986828701610db8565b9150509250925092565b6000806040838503121561100657600080fd5b50508035926020909101359150565b600082601f83011261102657600080fd5b813560206001600160401b0382111561104157611041610e4b565b8160051b611050828201610e61565b928352848101820192828101908785111561106a57600080fd5b83870192505b8483101561108957823582529183019190830190611070565b979650505050505050565b600080600080600060a086880312156110ac57600080fd5b85356110b781610d5b565b945060208601356110c781610d5b565b935060408601356001600160401b03808211156110e357600080fd5b6110ef89838a01611015565b9450606088013591508082111561110557600080fd5b61111189838a01611015565b9350608088013591508082111561112757600080fd5b5061113488828901610e91565b9150509295509295909350565b600080600080600060a0868803121561115957600080fd5b853561116481610d5b565b9450602086013561117481610d5b565b9350604086013592506060860135915060808601356001600160401b0381111561119d57600080fd5b61113488828901610e91565b6000602082840312156111bb57600080fd5b8135610d5481610d5b565b6000808335601e198436030181126111dd57600080fd5b8301803591506001600160401b038211156111f757600080fd5b602001915036819003821315610db157600080fd5b6000823560fe1983360301811261122257600080fd5b9190910192915050565b60006020828403121561123e57600080fd5b81356001600160401b0381168114610d5457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03841681526040602082018190526000906112b39083018486611265565b95945050505050565b6000806000606084860312156112d157600080fd5b8351925060208401519150604084015190509250925092565b8082018082111561035157634e487b7160e01b600052601160045260246000fd5b60006020828403121561131d57600080fd5b81518015158114610d5457600080fd5b6000808335601e1984360301811261134457600080fd5b8301803591506001600160401b0382111561135e57600080fd5b6020019150600581901b3603821315610db157600080fd5b6001600160401b03878116825286166020820152604081018590526060810184905260a060808201819052810182905260006001600160fb1b038311156113bc57600080fd5b8260051b808560c08501379190910160c001979650505050505050565b6000602082840312156113eb57600080fd5b5051919050565b604081526000835180604084015260005b818110156114205760208187018101516060868401015201611403565b506000606082850101526060601f19601f8301168401019150506001600160401b03831660208301529392505050565b60208152600061053460208301848661126556fea2646970667358221220c2f18f0c0761c62c649b63b6451f634e09c9561c6ebd2cc4dbbf503a1f564d2564736f6c63430008130033a26469706673582212200e595f47f5789d15c8cdb213eef272d728d7d9940b77e064910e264c902c62ca64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80630e1a07f5146100465780633648bfb514610075578063bd4f121914610088575b600080fd5b6100596100543660046102df565b61009b565b6040516001600160a01b03909116815260200160405180910390f35b610059610083366004610325565b610148565b6100596100963660046102df565b6101ef565b600080828686866040516100ae906102ba565b6001600160a01b03938416815292909116602083015260408201526060018190604051809103906000f59050801580156100ec573d6000803e3d6000fd5b50604080516001600160a01b03888116825260208201889052838116828401529151929350908816917fe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd9181900360600190a295945050505050565b60008084848460405161015a906102ba565b6001600160a01b0393841681529290911660208301526040820152606001604051809103906000f080158015610194573d6000803e3d6000fd5b50604080516001600160a01b03878116825260208201879052838116828401529151929350908716917fe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd9181900360600190a2949350505050565b60006102738260405180602001610205906102ba565b601f1982820381018352601f9091011660408181526001600160a01b038a811660208401528916908201526060810187905260800160408051601f19818403018152908290526102589291602001610396565b6040516020818303038152906040528051906020012061027c565b95945050505050565b6000610289838330610290565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b611710806103b483390190565b6001600160a01b03811681146102dc57600080fd5b50565b600080600080608085870312156102f557600080fd5b8435610300816102c7565b93506020850135610310816102c7565b93969395505050506040820135916060013590565b60008060006060848603121561033a57600080fd5b8335610345816102c7565b92506020840135610355816102c7565b929592945050506040919091013590565b6000815160005b81811015610387576020818501810151868301520161036d565b50600093019283525090919050565b60006103ab6103a58386610366565b84610366565b94935050505056fe60a06040523480156200001157600080fd5b506040516200171038038062001710833981016040819052620000349162000212565b6200003f33620000cb565b600180556200004e826200011b565b6080819052600380546001600160a01b0319166001600160a01b0385169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b158015620000a957600080fd5b505af1158015620000be573d6000803e3d6000fd5b505050505050506200025a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001256200019e565b6001600160a01b038116620001905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6200019b81620000cb565b50565b6000546001600160a01b03163314620001fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000187565b565b6001600160a01b03811681146200019b57600080fd5b6000806000606084860312156200022857600080fd5b83516200023581620001fc565b60208501519093506200024881620001fc565b80925050604084015190509250925092565b60805161149a6200027660003960006101ec015261149a6000f3fe6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063bc197c8111610059578063bc197c8114610288578063f23a6e61146102b4578063f2fde38b146102e0578063fc4116831461030057600080fd5b80638da5cb5b1461022a57806396487d46146102485780639d9b11451461026857600080fd5b8063179e740b116100bb578063179e740b14610186578063522f6815146101b857806361b12c66146101da578063715018a61461021557600080fd5b806301ffc9a7146100ed5780631250482f14610122578063150b7a021461014257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004610d2a565b610320565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061010d61013d366004610dd0565b610357565b34801561014e57600080fd5b5061016d61015d366004610f00565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610119565b34801561019257600080fd5b506003546001600160a01b03165b6040516001600160a01b039091168152602001610119565b3480156101c457600080fd5b506101d86101d3366004610f5f565b61053c565b005b3480156101e657600080fd5b506040517f00000000000000000000000000000000000000000000000000000000000000008152602001610119565b34801561022157600080fd5b506101d86105d5565b34801561023657600080fd5b506000546001600160a01b03166101a0565b34801561025457600080fd5b5061010d610263366004610f8b565b6105e9565b34801561027457600080fd5b5061010d610283366004610ff3565b61063a565b34801561029457600080fd5b5061016d6102a3366004611094565b63bc197c8160e01b95945050505050565b3480156102c057600080fd5b5061016d6102cf366004611141565b63f23a6e6160e01b95945050505050565b3480156102ec57600080fd5b506101d86102fb3660046111a9565b61064c565b34801561030c57600080fd5b506101d861031b3660046111a9565b6106ca565b60006001600160e01b03198216630271189760e51b148061035157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061036161077f565b600080808061037b61037660208801886111c6565b6107d8565b919550935091506103988383610391898061120c565b919061085f565b90506103b4898989876103ab8b8061120c565b939291906108a5565b60006103e86103c3888061120c565b6103d490604081019060200161122c565b6001600160401b03168360809190911b1790565b90506103f3816108da565b15610411576040516370de22b760e01b815260040160405180910390fd5b60008a6001600160a01b03168a8a60405161042d929190611255565b6000604051808303816000865af19150503d806000811461046a576040519150601f19603f3d011682016040523d82523d6000602084013e61046f565b606091505b505090508015610524576040516306449da160e41b815260026004820152602481018390526001604482015273__$f57eb21c11c6dae369da3ca36f4f48eb77$__90636449da109060640160006040518083038186803b1580156104d257600080fd5b505af41580156104e6573d6000803e3d6000fd5b505050507f0eb7ee080f865f1cadc4f54daf58cc3b8879e888832867d13351edcec0fbdc548260405161051b91815260200190565b60405180910390a15b9550505050505061053460018055565b949350505050565b33301461055c5760405163a08d601d60e01b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146105a9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ae565b606091505b50509050806105d057604051630ce8f45160e31b815260040160405180910390fd5b505050565b6105dd610958565b6105e760006109b2565b565b60008080806105fe61037660208701876111c6565b919450925090506106148282610391888061120c565b5061062d878785610625898061120c565b929190610a02565b5060019695505050505050565b6000608082901b8317610534816108da565b610654610958565b6001600160a01b0381166106be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6106c7816109b2565b50565b6106d2610958565b600380546001600160a01b0319166001600160a01b0383169081179091556040805163b688a36360e01b8152905163b688a3639160048082019260009290919082900301818387803b15801561072757600080fd5b505af115801561073b573d6000803e3d6000fd5b50506040516001600160a01b03841681527f4991c6f37185659e276ff918a96f3e20e6c5abcd8c9aab450dc19c2f7ad35cb59250602001905060405180910390a150565b6002600154036107d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106b5565b6002600155565b60035460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906108119030908990899060040161128e565b606060405180830381865afa15801561082e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085291906112bc565b9250925092509250925092565b60008061086f602086018661122c565b610882906001600160401b0316856112ea565b9050828111156105345760405163fd9ae91f60e01b815260040160405180910390fd5b60006108b2858585610a29565b90506108d2868284606083013560255b6001600160401b03166015610a58565b505050505050565b6040516303fbaf7360e01b8152600260048201526024810182905260009073__$f57eb21c11c6dae369da3ca36f4f48eb77$__906303fbaf7390604401602060405180830381865af4158015610934573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610351919061130b565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610a0e8484610cfe565b9050610a22858284608083013560256108c2565b5050505050565b6060838383604051602001610a409392919061128e565b60405160208183030381529060405290509392505050565b6040805160608089013560208301526080808a01359383019390935260a0890135908201528591016040516020818303038152906040528051906020012014610ab457604051636fbd3b7160e11b815260040160405180910390fd5b8273__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610af0610adf60208b018b61122c565b60051b681fffffffffffffffe01690565b60058660408c0135610b0560e08e018e61132d565b6040518763ffffffff1660e01b8152600401610b2696959493929190611376565b602060405180830381865af4158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6791906113d9565b14610b8557604051634371daa160e11b815260040160405180910390fd5b600073__$2a7ef22e717e9afc55afc95d018bf1a85b$__63c84583a18780519060200120604051602001610bbb91815260200190565b60408051601f19818403018152908290526001600160e01b031960e084901b168252610bec916005906004016113f2565b602060405180830381865af4158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906113d9565b9050866040013573__$2a7ef22e717e9afc55afc95d018bf1a85b$__6379de4601610c648a6020016020810190610adf919061122c565b60058686610c7560c08f018f61132d565b6040518763ffffffff1660e01b8152600401610c9696959493929190611376565b602060405180830381865af4158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd791906113d9565b14610cf55760405163017c689560e61b815260040160405180910390fd5b50505050505050565b60608282604051602001610d13929190611450565b604051602081830303815290604052905092915050565b600060208284031215610d3c57600080fd5b81356001600160e01b031981168114610d5457600080fd5b9392505050565b6001600160a01b03811681146106c757600080fd5b60008083601f840112610d8257600080fd5b5081356001600160401b03811115610d9957600080fd5b602083019150836020828501011115610db157600080fd5b9250929050565b600060408284031215610dca57600080fd5b50919050565b60008060008060608587031215610de657600080fd5b8435610df181610d5b565b935060208501356001600160401b0380821115610e0d57600080fd5b610e1988838901610d70565b90955093506040870135915080821115610e3257600080fd5b50610e3f87828801610db8565b91505092959194509250565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610e8957610e89610e4b565b604052919050565b600082601f830112610ea257600080fd5b81356001600160401b03811115610ebb57610ebb610e4b565b610ece601f8201601f1916602001610e61565b818152846020838601011115610ee357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610f1657600080fd5b8435610f2181610d5b565b93506020850135610f3181610d5b565b92506040850135915060608501356001600160401b03811115610f5357600080fd5b610e3f87828801610e91565b60008060408385031215610f7257600080fd5b8235610f7d81610d5b565b946020939093013593505050565b600080600060408486031215610fa057600080fd5b83356001600160401b0380821115610fb757600080fd5b610fc387838801610d70565b90955093506020860135915080821115610fdc57600080fd5b50610fe986828701610db8565b9150509250925092565b6000806040838503121561100657600080fd5b50508035926020909101359150565b600082601f83011261102657600080fd5b813560206001600160401b0382111561104157611041610e4b565b8160051b611050828201610e61565b928352848101820192828101908785111561106a57600080fd5b83870192505b8483101561108957823582529183019190830190611070565b979650505050505050565b600080600080600060a086880312156110ac57600080fd5b85356110b781610d5b565b945060208601356110c781610d5b565b935060408601356001600160401b03808211156110e357600080fd5b6110ef89838a01611015565b9450606088013591508082111561110557600080fd5b61111189838a01611015565b9350608088013591508082111561112757600080fd5b5061113488828901610e91565b9150509295509295909350565b600080600080600060a0868803121561115957600080fd5b853561116481610d5b565b9450602086013561117481610d5b565b9350604086013592506060860135915060808601356001600160401b0381111561119d57600080fd5b61113488828901610e91565b6000602082840312156111bb57600080fd5b8135610d5481610d5b565b6000808335601e198436030181126111dd57600080fd5b8301803591506001600160401b038211156111f757600080fd5b602001915036819003821315610db157600080fd5b6000823560fe1983360301811261122257600080fd5b9190910192915050565b60006020828403121561123e57600080fd5b81356001600160401b0381168114610d5457600080fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03841681526040602082018190526000906112b39083018486611265565b95945050505050565b6000806000606084860312156112d157600080fd5b8351925060208401519150604084015190509250925092565b8082018082111561035157634e487b7160e01b600052601160045260246000fd5b60006020828403121561131d57600080fd5b81518015158114610d5457600080fd5b6000808335601e1984360301811261134457600080fd5b8301803591506001600160401b0382111561135e57600080fd5b6020019150600581901b3603821315610db157600080fd5b6001600160401b03878116825286166020820152604081018590526060810184905260a060808201819052810182905260006001600160fb1b038311156113bc57600080fd5b8260051b808560c08501379190910160c001979650505050505050565b6000602082840312156113eb57600080fd5b5051919050565b604081526000835180604084015260005b818110156114205760208187018101516060868401015201611403565b506000606082850101526060601f19601f8301168401019150506001600160401b03831660208301529392505050565b60208152600061053460208301848661126556fea2646970667358221220c2f18f0c0761c62c649b63b6451f634e09c9561c6ebd2cc4dbbf503a1f564d2564736f6c63430008130033a26469706673582212200e595f47f5789d15c8cdb213eef272d728d7d9940b77e064910e264c902c62ca64736f6c63430008130033", - "linkReferences": { - "@cartesi/util/contracts/Bitmask.sol": { - "Bitmask": [ - { - "length": 20, - "start": 2791 - }, - { - "length": 20, - "start": 3908 - } - ] - }, - "@cartesi/util/contracts/MerkleV2.sol": { - "MerkleV2": [ - { - "length": 20, - "start": 4353 - }, - { - "length": 20, - "start": 4563 - }, - { - "length": 20, - "start": 4736 - } - ] - } - }, - "deployedLinkReferences": { - "@cartesi/util/contracts/Bitmask.sol": { - "Bitmask": [ - { - "length": 20, - "start": 2759 - }, - { - "length": 20, - "start": 3876 - } - ] - }, - "@cartesi/util/contracts/MerkleV2.sol": { - "MerkleV2": [ - { - "length": 20, - "start": 4321 - }, - { - "length": 20, - "start": 4531 - }, - { - "length": 20, - "start": 4704 - } - ] - } - }, - "devdoc": { - "events": { - "ApplicationCreated(address,address,bytes32,address)": { - "details": "MUST be triggered on a successful call to `newApplication`.", - "params": { - "application": "The application", - "consensus": "The initial consensus contract", - "dappOwner": "The initial DApp owner", - "templateHash": "The initial machine state hash" - } - } - }, - "kind": "dev", - "methods": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": { - "details": "Beware that only the `newApplication` function with the `_salt` parameter is able to deterministically deploy an application.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_salt": "The salt used to deterministically generate the DApp address", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The deterministic application address" - } - }, - "newApplication(address,address,bytes32)": { - "details": "On success, MUST emit an `ApplicationCreated` event.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The application" - } - }, - "newApplication(address,address,bytes32,bytes32)": { - "details": "On success, MUST emit an `ApplicationCreated` event.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_salt": "The salt used to deterministically generate the DApp address", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The application" - } - } - }, - "title": "Cartesi DApp Factory", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationCreated(address,address,bytes32,address)": { - "notice": "A new application was deployed." - } - }, - "kind": "user", - "methods": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": { - "notice": "Calculate the address of an application to be deployed deterministically." - }, - "newApplication(address,address,bytes32)": { - "notice": "Deploy a new application." - }, - "newApplication(address,address,bytes32,bytes32)": { - "notice": "Deploy a new application deterministically." - } - }, - "notice": "Allows anyone to reliably deploy a new `CartesiDApp` contract.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "1381000", - "executionCost": "1438", - "totalCost": "1382438" - }, - "external": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": "infinite", - "newApplication(address,address,bytes32)": "infinite", - "newApplication(address,address,bytes32,bytes32)": "infinite" - } - }, - "methodIdentifiers": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": "bd4f1219", - "newApplication(address,address,bytes32)": "3648bfb5", - "newApplication(address,address,bytes32,bytes32)": "0e1a07f5" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json b/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json deleted file mode 100644 index 78a1082d7..000000000 --- a/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDApp.sol/ICartesiDApp.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "contractName": "ICartesiDApp", - "sourceName": "contracts/dapp/ICartesiDApp.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IConsensus", - "name": "newConsensus", - "type": "address" - } - ], - "name": "NewConsensus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "voucherId", - "type": "uint256" - } - ], - "name": "VoucherExecuted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_destination", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint64", - "name": "inputIndexWithinEpoch", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "outputIndexWithinInput", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "outputHashesRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "vouchersEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "noticesEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "machineStateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "outputHashInOutputHashesSiblings", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "outputHashesInEpochSiblings", - "type": "bytes32[]" - } - ], - "internalType": "struct OutputValidityProof", - "name": "validity", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "context", - "type": "bytes" - } - ], - "internalType": "struct Proof", - "name": "_proof", - "type": "tuple" - } - ], - "name": "executeVoucher", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getConsensus", - "outputs": [ - { - "internalType": "contract IConsensus", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTemplateHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_newConsensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_notice", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint64", - "name": "inputIndexWithinEpoch", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "outputIndexWithinInput", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "outputHashesRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "vouchersEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "noticesEpochRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "machineStateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "outputHashInOutputHashesSiblings", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "outputHashesInEpochSiblings", - "type": "bytes32[]" - } - ], - "internalType": "struct OutputValidityProof", - "name": "validity", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "context", - "type": "bytes" - } - ], - "internalType": "struct Proof", - "name": "_proof", - "type": "tuple" - } - ], - "name": "validateNotice", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inboxInputIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_outputIndexWithinInput", - "type": "uint256" - } - ], - "name": "wasVoucherExecuted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "NewConsensus(address)": { - "details": "MUST be triggered on a successful call to `migrateToConsensus`.", - "params": { - "newConsensus": "The new consensus contract" - } - }, - "VoucherExecuted(uint256)": { - "params": { - "voucherId": "A number that uniquely identifies the voucher amongst all vouchers emitted by this DApp" - } - } - }, - "kind": "dev", - "methods": { - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "details": "On a successful execution, emits a `VoucherExecuted` event. Execution of already executed voucher will raise a `VoucherReexecutionNotAllowed` error.", - "params": { - "_destination": "The address that will receive the payload through a message call", - "_payload": "The payload, which—in the case of Solidity contracts—encodes a function call", - "_proof": "The proof used to validate the voucher against a claim submitted by the current consensus contract" - }, - "returns": { - "_0": "Whether the execution was successful or not" - } - }, - "getConsensus()": { - "returns": { - "_0": "The current consensus" - } - }, - "getTemplateHash()": { - "returns": { - "_0": "The DApp's template hash" - } - }, - "migrateToConsensus(address)": { - "details": "Can only be called by the DApp owner.", - "params": { - "_newConsensus": "The new consensus" - } - }, - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "params": { - "_notice": "The notice", - "_proof": "Data for validating outputs" - }, - "returns": { - "_0": "Whether the notice is valid or not" - } - }, - "wasVoucherExecuted(uint256,uint256)": { - "params": { - "_inboxInputIndex": "The index of the input in the input box", - "_outputIndexWithinInput": "The index of output emitted by the input" - }, - "returns": { - "_0": "Whether the voucher has been executed before" - } - } - }, - "title": "Cartesi DApp interface", - "version": 1 - }, - "userdoc": { - "events": { - "NewConsensus(address)": { - "notice": "The DApp has migrated to another consensus contract." - }, - "VoucherExecuted(uint256)": { - "notice": "A voucher was executed from the DApp." - } - }, - "kind": "user", - "methods": { - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "notice": "Try to execute a voucher. Reverts if voucher was already successfully executed." - }, - "getConsensus()": { - "notice": "Get the current consensus." - }, - "getTemplateHash()": { - "notice": "Get the DApp's template hash." - }, - "migrateToConsensus(address)": { - "notice": "Migrate the DApp to a new consensus." - }, - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": { - "notice": "Validate a notice." - }, - "wasVoucherExecuted(uint256,uint256)": { - "notice": "Check whether a voucher has been executed." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "executeVoucher(address,bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "1250482f", - "getConsensus()": "179e740b", - "getTemplateHash()": "61b12c66", - "migrateToConsensus(address)": "fc411683", - "validateNotice(bytes,((uint64,uint64,bytes32,bytes32,bytes32,bytes32,bytes32[],bytes32[]),bytes))": "96487d46", - "wasVoucherExecuted(uint256,uint256)": "9d9b1145" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDAppFactory.sol/ICartesiDAppFactory.json b/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDAppFactory.sol/ICartesiDAppFactory.json deleted file mode 100644 index 4c17ee2f2..000000000 --- a/onchain/rollups/export/artifacts/contracts/dapp/ICartesiDAppFactory.sol/ICartesiDAppFactory.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "contractName": "ICartesiDAppFactory", - "sourceName": "contracts/dapp/ICartesiDAppFactory.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract IConsensus", - "name": "consensus", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "dappOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "templateHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "contract CartesiDApp", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationCreated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "calculateApplicationAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "newApplication", - "outputs": [ - { - "internalType": "contract CartesiDApp", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IConsensus", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_dappOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_templateHash", - "type": "bytes32" - } - ], - "name": "newApplication", - "outputs": [ - { - "internalType": "contract CartesiDApp", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "ApplicationCreated(address,address,bytes32,address)": { - "details": "MUST be triggered on a successful call to `newApplication`.", - "params": { - "application": "The application", - "consensus": "The initial consensus contract", - "dappOwner": "The initial DApp owner", - "templateHash": "The initial machine state hash" - } - } - }, - "kind": "dev", - "methods": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": { - "details": "Beware that only the `newApplication` function with the `_salt` parameter is able to deterministically deploy an application.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_salt": "The salt used to deterministically generate the DApp address", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The deterministic application address" - } - }, - "newApplication(address,address,bytes32)": { - "details": "On success, MUST emit an `ApplicationCreated` event.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The application" - } - }, - "newApplication(address,address,bytes32,bytes32)": { - "details": "On success, MUST emit an `ApplicationCreated` event.", - "params": { - "_consensus": "The initial consensus contract", - "_dappOwner": "The initial DApp owner", - "_salt": "The salt used to deterministically generate the DApp address", - "_templateHash": "The initial machine state hash" - }, - "returns": { - "_0": "The application" - } - } - }, - "title": "Cartesi DApp Factory interface", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationCreated(address,address,bytes32,address)": { - "notice": "A new application was deployed." - } - }, - "kind": "user", - "methods": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": { - "notice": "Calculate the address of an application to be deployed deterministically." - }, - "newApplication(address,address,bytes32)": { - "notice": "Deploy a new application." - }, - "newApplication(address,address,bytes32,bytes32)": { - "notice": "Deploy a new application deterministically." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "calculateApplicationAddress(address,address,bytes32,bytes32)": "bd4f1219", - "newApplication(address,address,bytes32)": "3648bfb5", - "newApplication(address,address,bytes32,bytes32)": "0e1a07f5" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/history/History.sol/History.json b/onchain/rollups/export/artifacts/contracts/history/History.sol/History.json deleted file mode 100644 index 9f7b54b35..000000000 --- a/onchain/rollups/export/artifacts/contracts/history/History.sol/History.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "contractName": "History", - "sourceName": "contracts/history/History.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidClaimIndex", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputIndices", - "type": "error" - }, - { - "inputs": [], - "name": "UnclaimedInputs", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b5060405161091e38038061091e83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075e806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f366004610531565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610586565b6101bf565b61006f6100e03660046105c8565b61039a565b61006f6100f33660046105c8565b610418565b610100610429565b61010a6000610483565b565b600080808061011d858701876105ec565b6001600160a01b038816600090815260016020526040902054909150808210610159576040516387332c0160e01b815260040160405180910390fd5b506001600160a01b0396909616600090815260026020908152604080832098835297815290879020875160608101895281548082526001909201546001600160801b03808216948301859052600160801b90910416980188905297909695509350505050565b6101c7610429565b6000806101d683850185610621565b9150915080604001516001600160801b031681602001516001600160801b031611156102155760405163123974fd60e01b815260040160405180910390fd5b6001600160a01b038216600090815260016020526040902054801561028e576001600160a01b0383166000908152600260205260408120906102586001846106d5565b815260200190815260200160002060010160109054906101000a90046001600160801b0316600161028991906106ee565b610291565b60005b6001600160801b031682602001516001600160801b0316146102c65760405163118b891b60e01b815260040160405180910390fd5b6001600160a01b03831660009081526002602090815260408083208484528252918290208451815590840151918401516001600160801b03908116600160801b0292169190911760019182015561031e908290610715565b6001600160a01b03841660008181526001602090815260409182902093909355805185518152858401516001600160801b03908116948201949094528582015190931690830152907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a25050505050565b6103a2610429565b6001600160a01b03811661040c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61041581610483565b50565b610420610429565b6104158161039a565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610403565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041557600080fd5b60008083601f8401126104fa57600080fd5b50813567ffffffffffffffff81111561051257600080fd5b60208301915083602082850101111561052a57600080fd5b9250929050565b60008060006040848603121561054657600080fd5b8335610551816104d3565b9250602084013567ffffffffffffffff81111561056d57600080fd5b610579868287016104e8565b9497909650939450505050565b6000806020838503121561059957600080fd5b823567ffffffffffffffff8111156105b057600080fd5b6105bc858286016104e8565b90969095509350505050565b6000602082840312156105da57600080fd5b81356105e5816104d3565b9392505050565b6000602082840312156105fe57600080fd5b5035919050565b80356001600160801b038116811461061c57600080fd5b919050565b600080828403608081121561063557600080fd5b8335610640816104d3565b92506060601f198201121561065457600080fd5b506040516060810181811067ffffffffffffffff8211171561068657634e487b7160e01b600052604160045260246000fd5b80604052506020840135815261069e60408501610605565b60208201526106af60608501610605565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106e8576106e86106bf565b92915050565b6001600160801b0381811683821601908082111561070e5761070e6106bf565b5092915050565b808201808211156106e8576106e86106bf56fea2646970667358221220bc9e05e2ae74db3b38d6eacf239a60762e30b7260252e284ff640bb8da4577b064736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f366004610531565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610586565b6101bf565b61006f6100e03660046105c8565b61039a565b61006f6100f33660046105c8565b610418565b610100610429565b61010a6000610483565b565b600080808061011d858701876105ec565b6001600160a01b038816600090815260016020526040902054909150808210610159576040516387332c0160e01b815260040160405180910390fd5b506001600160a01b0396909616600090815260026020908152604080832098835297815290879020875160608101895281548082526001909201546001600160801b03808216948301859052600160801b90910416980188905297909695509350505050565b6101c7610429565b6000806101d683850185610621565b9150915080604001516001600160801b031681602001516001600160801b031611156102155760405163123974fd60e01b815260040160405180910390fd5b6001600160a01b038216600090815260016020526040902054801561028e576001600160a01b0383166000908152600260205260408120906102586001846106d5565b815260200190815260200160002060010160109054906101000a90046001600160801b0316600161028991906106ee565b610291565b60005b6001600160801b031682602001516001600160801b0316146102c65760405163118b891b60e01b815260040160405180910390fd5b6001600160a01b03831660009081526002602090815260408083208484528252918290208451815590840151918401516001600160801b03908116600160801b0292169190911760019182015561031e908290610715565b6001600160a01b03841660008181526001602090815260409182902093909355805185518152858401516001600160801b03908116948201949094528582015190931690830152907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a25050505050565b6103a2610429565b6001600160a01b03811661040c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61041581610483565b50565b610420610429565b6104158161039a565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610403565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041557600080fd5b60008083601f8401126104fa57600080fd5b50813567ffffffffffffffff81111561051257600080fd5b60208301915083602082850101111561052a57600080fd5b9250929050565b60008060006040848603121561054657600080fd5b8335610551816104d3565b9250602084013567ffffffffffffffff81111561056d57600080fd5b610579868287016104e8565b9497909650939450505050565b6000806020838503121561059957600080fd5b823567ffffffffffffffff8111156105b057600080fd5b6105bc858286016104e8565b90969095509350505050565b6000602082840312156105da57600080fd5b81356105e5816104d3565b9392505050565b6000602082840312156105fe57600080fd5b5035919050565b80356001600160801b038116811461061c57600080fd5b919050565b600080828403608081121561063557600080fd5b8335610640816104d3565b92506060601f198201121561065457600080fd5b506040516060810181811067ffffffffffffffff8211171561068657634e487b7160e01b600052604160045260246000fd5b80604052506020840135815261069e60408501610605565b60208201526106af60608501610605565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106e8576106e86106bf565b92915050565b6001600160801b0381811683821601908082111561070e5761070e6106bf565b5092915050565b808201808211156106e8576106e86106bf56fea2646970667358221220bc9e05e2ae74db3b38d6eacf239a60762e30b7260252e284ff640bb8da4577b064736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "details": "If `claimIndex` is not inside the interval `[0, n)`, then an `InvalidClaimIndex` error is raised.", - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control. Incorrect claim input indices could raise two errors: `InvalidInputIndices` if first index is posterior than last index or `UnclaimedInputs` if first index is not the subsequent of previous claimed index or if the first index of the first claim is not zero.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "errors": { - "InvalidClaimIndex()": [ - { - "notice": "Raised when one tries to retrieve a claim with an invalid index." - } - ], - "InvalidInputIndices()": [ - { - "notice": "Raised when one tries to submit a claim whose first input index is not less than or equal to its last input index." - } - ], - "UnclaimedInputs()": [ - { - "notice": "Raised when one tries to submit a claim that skips some input. For example, when the 1st claim starts at index 5 (instead of 0) or when the 1st claim ends at index 20 but the 2nd claim starts at index 22 (instead of 21)." - } - ] - }, - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "377200", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "getClaim(address,bytes)": "7504", - "migrateToConsensus(address)": "infinite", - "owner()": "2290", - "renounceOwnership()": "infinite", - "submitClaim(bytes)": "infinite", - "transferOwnership(address)": "infinite" - } - }, - "methodIdentifiers": { - "getClaim(address,bytes)": "d79a8240", - "migrateToConsensus(address)": "fc411683", - "owner()": "8da5cb5b", - "renounceOwnership()": "715018a6", - "submitClaim(bytes)": "ddfdfbb0", - "transferOwnership(address)": "f2fde38b" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/history/IHistory.sol/IHistory.json b/onchain/rollups/export/artifacts/contracts/history/IHistory.sol/IHistory.json deleted file mode 100644 index 2e2d87529..000000000 --- a/onchain/rollups/export/artifacts/contracts/history/IHistory.sol/IHistory.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "contractName": "IHistory", - "sourceName": "contracts/history/IHistory.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "epochHash_", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "firstInputIndex_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastInputIndex_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "epochHash_": "The claimed epoch hash", - "firstInputIndex_": "The index of the first input of the epoch in the input box", - "lastInputIndex_": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "submitClaim(bytes)": { - "details": "Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - } - }, - "title": "History interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. The encoding of `_proofContext` might vary depending on the history implementation." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim. The encoding of `_claimData` might vary depending on the history implementation." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "getClaim(address,bytes)": "d79a8240", - "migrateToConsensus(address)": "fc411683", - "submitClaim(bytes)": "ddfdfbb0" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/inputs/IInputBox.sol/IInputBox.json b/onchain/rollups/export/artifacts/contracts/inputs/IInputBox.sol/IInputBox.json deleted file mode 100644 index 59d507392..000000000 --- a/onchain/rollups/export/artifacts/contracts/inputs/IInputBox.sol/IInputBox.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "contractName": "IInputBox", - "sourceName": "contracts/inputs/IInputBox.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "inboxInputIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "input", - "type": "bytes" - } - ], - "name": "InputAdded", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_input", - "type": "bytes" - } - ], - "name": "addInput", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "getInputHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - } - ], - "name": "getNumberOfInputs", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "InputAdded(address,uint256,address,bytes)": { - "details": "MUST be triggered on a successful call to `addInput`.", - "params": { - "dapp": "The address of the DApp", - "inboxInputIndex": "The index of the input in the input box", - "input": "The contents of the input", - "sender": "The address that sent the input" - } - } - }, - "kind": "dev", - "methods": { - "addInput(address,bytes)": { - "details": "MUST fire an `InputAdded` event accordingly. Input larger than machine limit will raise `InputSizeExceedsLimit` error.", - "params": { - "_dapp": "The address of the DApp", - "_input": "The contents of the input" - }, - "returns": { - "_0": "The hash of the input plus some extra metadata" - } - }, - "getInputHash(address,uint256)": { - "details": "`_index` MUST be in the interval `[0,n)` where `n` is the number of inputs in the DApp's input box. See the `getNumberOfInputs` function.", - "params": { - "_dapp": "The address of the DApp", - "_index": "The index of the input in the DApp's input box" - }, - "returns": { - "_0": "The hash of the input at the provided index in the DApp's input box" - } - }, - "getNumberOfInputs(address)": { - "params": { - "_dapp": "The address of the DApp" - }, - "returns": { - "_0": "Number of inputs in the DApp's input box" - } - } - }, - "title": "Input Box interface", - "version": 1 - }, - "userdoc": { - "events": { - "InputAdded(address,uint256,address,bytes)": { - "notice": "Emitted when an input is added to a DApp's input box." - } - }, - "kind": "user", - "methods": { - "addInput(address,bytes)": { - "notice": "Add an input to a DApp's input box." - }, - "getInputHash(address,uint256)": { - "notice": "Get the hash of an input in a DApp's input box." - }, - "getNumberOfInputs(address)": { - "notice": "Get the number of inputs in a DApp's input box." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "addInput(address,bytes)": "1789cd63", - "getInputHash(address,uint256)": "677087c9", - "getNumberOfInputs(address)": "61a93c87" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/inputs/IInputRelay.sol/IInputRelay.json b/onchain/rollups/export/artifacts/contracts/inputs/IInputRelay.sol/IInputRelay.json deleted file mode 100644 index 837fd45cc..000000000 --- a/onchain/rollups/export/artifacts/contracts/inputs/IInputRelay.sol/IInputRelay.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "contractName": "IInputRelay", - "sourceName": "contracts/inputs/IInputRelay.sol", - "abi": [ - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "Input Relay interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/inputs/InputBox.sol/InputBox.json b/onchain/rollups/export/artifacts/contracts/inputs/InputBox.sol/InputBox.json deleted file mode 100644 index ea5196e33..000000000 --- a/onchain/rollups/export/artifacts/contracts/inputs/InputBox.sol/InputBox.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "contractName": "InputBox", - "sourceName": "contracts/inputs/InputBox.sol", - "abi": [ - { - "inputs": [], - "name": "InputSizeExceedsLimit", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "inboxInputIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "input", - "type": "bytes" - } - ], - "name": "InputAdded", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_input", - "type": "bytes" - } - ], - "name": "addInput", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "getInputHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - } - ], - "name": "getNumberOfInputs", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b506103be806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631789cd631461004657806361a93c871461006b578063677087c914610094575b600080fd5b610059610054366004610253565b6100a7565b60405190815260200160405180910390f35b6100596100793660046102d6565b6001600160a01b031660009081526020819052604090205490565b6100596100a23660046102f8565b61013b565b6001600160a01b03831660009081526020819052604081208054826100d0334342898987610178565b83546001810185556000858152602090200181905560405190915082906001600160a01b038916907f6aaa400068bf4ca337265e2a1e1e841f66b8597fd5b452fdc52a44bed28a0784906101299033908b908b90610322565b60405180910390a39695505050505050565b6001600160a01b038216600090815260208190526040812080548390811061016557610165610362565b9060005260206000200154905092915050565b6000621fffc083111561019e57604051634273a49560e11b815260040160405180910390fd5b604080516001600160a01b03891660208201529081018790526060810186905260006080820181905260a082018490529060c001604051602081830303815290604052805190602001209050600085856040516101fc929190610378565b604080519182900382206020808401959095528282015280518083038201815260609092019052805192019190912098975050505050505050565b80356001600160a01b038116811461024e57600080fd5b919050565b60008060006040848603121561026857600080fd5b61027184610237565b9250602084013567ffffffffffffffff8082111561028e57600080fd5b818601915086601f8301126102a257600080fd5b8135818111156102b157600080fd5b8760208285010111156102c357600080fd5b6020830194508093505050509250925092565b6000602082840312156102e857600080fd5b6102f182610237565b9392505050565b6000806040838503121561030b57600080fd5b61031483610237565b946020939093013593505050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052603260045260246000fd5b818382376000910190815291905056fea2646970667358221220caf75d10cc4da0a535161edf26b2b6cac92541e6980ef3fffcb2e38aae1a992a64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80631789cd631461004657806361a93c871461006b578063677087c914610094575b600080fd5b610059610054366004610253565b6100a7565b60405190815260200160405180910390f35b6100596100793660046102d6565b6001600160a01b031660009081526020819052604090205490565b6100596100a23660046102f8565b61013b565b6001600160a01b03831660009081526020819052604081208054826100d0334342898987610178565b83546001810185556000858152602090200181905560405190915082906001600160a01b038916907f6aaa400068bf4ca337265e2a1e1e841f66b8597fd5b452fdc52a44bed28a0784906101299033908b908b90610322565b60405180910390a39695505050505050565b6001600160a01b038216600090815260208190526040812080548390811061016557610165610362565b9060005260206000200154905092915050565b6000621fffc083111561019e57604051634273a49560e11b815260040160405180910390fd5b604080516001600160a01b03891660208201529081018790526060810186905260006080820181905260a082018490529060c001604051602081830303815290604052805190602001209050600085856040516101fc929190610378565b604080519182900382206020808401959095528282015280518083038201815260609092019052805192019190912098975050505050505050565b80356001600160a01b038116811461024e57600080fd5b919050565b60008060006040848603121561026857600080fd5b61027184610237565b9250602084013567ffffffffffffffff8082111561028e57600080fd5b818601915086601f8301126102a257600080fd5b8135818111156102b157600080fd5b8760208285010111156102c357600080fd5b6020830194508093505050509250925092565b6000602082840312156102e857600080fd5b6102f182610237565b9392505050565b6000806040838503121561030b57600080fd5b61031483610237565b946020939093013593505050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052603260045260246000fd5b818382376000910190815291905056fea2646970667358221220caf75d10cc4da0a535161edf26b2b6cac92541e6980ef3fffcb2e38aae1a992a64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "events": { - "InputAdded(address,uint256,address,bytes)": { - "details": "MUST be triggered on a successful call to `addInput`.", - "params": { - "dapp": "The address of the DApp", - "inboxInputIndex": "The index of the input in the input box", - "input": "The contents of the input", - "sender": "The address that sent the input" - } - } - }, - "kind": "dev", - "methods": { - "addInput(address,bytes)": { - "details": "MUST fire an `InputAdded` event accordingly. Input larger than machine limit will raise `InputSizeExceedsLimit` error.", - "params": { - "_dapp": "The address of the DApp", - "_input": "The contents of the input" - }, - "returns": { - "_0": "The hash of the input plus some extra metadata" - } - }, - "getInputHash(address,uint256)": { - "details": "`_index` MUST be in the interval `[0,n)` where `n` is the number of inputs in the DApp's input box. See the `getNumberOfInputs` function.", - "params": { - "_dapp": "The address of the DApp", - "_index": "The index of the input in the DApp's input box" - }, - "returns": { - "_0": "The hash of the input at the provided index in the DApp's input box" - } - }, - "getNumberOfInputs(address)": { - "params": { - "_dapp": "The address of the DApp" - }, - "returns": { - "_0": "Number of inputs in the DApp's input box" - } - } - }, - "stateVariables": { - "inputBoxes": { - "details": "See the `getNumberOfInputs`, `getInputHash` and `addInput` functions." - } - }, - "title": "Input Box", - "version": 1 - }, - "userdoc": { - "errors": { - "InputSizeExceedsLimit()": [ - { - "notice": "Raised when input is larger than the machine limit." - } - ] - }, - "events": { - "InputAdded(address,uint256,address,bytes)": { - "notice": "Emitted when an input is added to a DApp's input box." - } - }, - "kind": "user", - "methods": { - "addInput(address,bytes)": { - "notice": "Add an input to a DApp's input box." - }, - "getInputHash(address,uint256)": { - "notice": "Get the hash of an input in a DApp's input box." - }, - "getNumberOfInputs(address)": { - "notice": "Get the number of inputs in a DApp's input box." - } - }, - "notice": "Trustless and permissionless contract that receives arbitrary blobs (called \"inputs\") from anyone and adds a compound hash to an append-only list (called \"input box\"). Each DApp has its own input box. The hash that is stored on-chain is composed by the hash of the input blob, the block number and timestamp, the input sender address, and the input index. Data availability is guaranteed by the emission of `InputAdded` events on every successful call to `addInput`. This ensures that inputs can be retrieved by anyone at any time, without having to rely on centralized data providers. From the perspective of this contract, inputs are encoding-agnostic byte arrays. It is up to the DApp to interpret, validate and act upon inputs.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "191600", - "executionCost": "232", - "totalCost": "191832" - }, - "external": { - "addInput(address,bytes)": "infinite", - "getInputHash(address,uint256)": "4781", - "getNumberOfInputs(address)": "2528" - } - }, - "methodIdentifiers": { - "addInput(address,bytes)": "1789cd63", - "getInputHash(address,uint256)": "677087c9", - "getNumberOfInputs(address)": "61a93c87" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/inputs/InputRelay.sol/InputRelay.json b/onchain/rollups/export/artifacts/contracts/inputs/InputRelay.sol/InputRelay.json deleted file mode 100644 index 24aa940c5..000000000 --- a/onchain/rollups/export/artifacts/contracts/inputs/InputRelay.sol/InputRelay.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "contractName": "InputRelay", - "sourceName": "contracts/inputs/InputRelay.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b5060405161012738038061012783398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051609f6100886000396000602e0152609f6000f3fe6080604052348015600f57600080fd5b506004361060275760003560e01c8062aace9a14602c575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f3fea264697066735822122027d3e8815006903848507896ca292c934fecb106d4757454c435b575d5df45a264736f6c63430008130033", - "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060275760003560e01c8062aace9a14602c575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f3fea264697066735822122027d3e8815006903848507896ca292c934fecb106d4757454c435b575d5df45a264736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the input relay" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "Input Relay", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the input relay." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract serves as a base for all the other input relays.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "31800", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/library/LibInput.sol/LibInput.json b/onchain/rollups/export/artifacts/contracts/library/LibInput.sol/LibInput.json deleted file mode 100644 index c05e43996..000000000 --- a/onchain/rollups/export/artifacts/contracts/library/LibInput.sol/LibInput.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "contractName": "LibInput", - "sourceName": "contracts/library/LibInput.sol", - "abi": [ - { - "inputs": [], - "name": "InputSizeExceedsLimit", - "type": "error" - } - ], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122009dcbbbd41abeab2a279cbadbe6e6ca4d275e563ff4abd24bb9795aac0020a3c64736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122009dcbbbd41abeab2a279cbadbe6e6ca4d275e563ff4abd24bb9795aac0020a3c64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "title": "Input Library", - "version": 1 - }, - "userdoc": { - "errors": { - "InputSizeExceedsLimit()": [ - { - "notice": "Raised when input is larger than the machine limit." - } - ] - }, - "kind": "user", - "methods": {}, - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "computeInputHash(address,uint256,uint256,bytes calldata,uint256)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/library/LibOutputValidation.sol/LibOutputValidation.json b/onchain/rollups/export/artifacts/contracts/library/LibOutputValidation.sol/LibOutputValidation.json deleted file mode 100644 index 3cc437664..000000000 --- a/onchain/rollups/export/artifacts/contracts/library/LibOutputValidation.sol/LibOutputValidation.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "contractName": "LibOutputValidation", - "sourceName": "contracts/library/LibOutputValidation.sol", - "abi": [ - { - "inputs": [], - "name": "IncorrectEpochHash", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectOutputHashesRootHash", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectOutputsEpochRootHash", - "type": "error" - }, - { - "inputs": [], - "name": "InputIndexOutOfClaimBounds", - "type": "error" - } - ], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a6d5e460299a03d10523f209cc7c62da3825302c2713ad77256d91ba81f1d58164736f6c63430008130033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a6d5e460299a03d10523f209cc7c62da3825302c2713ad77256d91ba81f1d58164736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "title": "Output Validation Library", - "version": 1 - }, - "userdoc": { - "errors": { - "IncorrectEpochHash()": [ - { - "notice": "Raised when some `OutputValidityProof` variables does not match the presented finalized epoch." - } - ], - "IncorrectOutputHashesRootHash()": [ - { - "notice": "Raised when Merkle root of output hash is NOT contained in the output metadata array memory range." - } - ], - "IncorrectOutputsEpochRootHash()": [ - { - "notice": "Raised when `OutputValidityProof` metadata memory range is NOT contained in epoch's output memory range." - } - ], - "InputIndexOutOfClaimBounds()": [ - { - "notice": "Raised when epoch input index is NOT compatible with the provided input index range." - } - ] - }, - "kind": "user", - "methods": {}, - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "17200", - "executionCost": "103", - "totalCost": "17303" - }, - "internal": { - "getBitMaskPosition(uint256,uint256)": "infinite", - "validateEncodedOutput(struct OutputValidityProof calldata,bytes memory,bytes32,bytes32,uint256,uint256)": "infinite", - "validateInputIndexRange(struct OutputValidityProof calldata,uint256,uint256)": "infinite", - "validateNotice(struct OutputValidityProof calldata,bytes calldata,bytes32)": "infinite", - "validateVoucher(struct OutputValidityProof calldata,address,bytes calldata,bytes32)": "infinite" - } - }, - "methodIdentifiers": {} - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/ERC1155BatchPortal.sol/ERC1155BatchPortal.json b/onchain/rollups/export/artifacts/contracts/portals/ERC1155BatchPortal.sol/ERC1155BatchPortal.json deleted file mode 100644 index 0f5cbf21a..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/ERC1155BatchPortal.sol/ERC1155BatchPortal.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "contractName": "ERC1155BatchPortal", - "sourceName": "contracts/portals/ERC1155BatchPortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "contract IERC1155", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "_tokenIds", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "_values", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositBatchERC1155Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b5060405161064538038061064583398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516105b461009160003960008181603c015261012601526105b46000f3fe608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806324d15c6714610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a6100853660046102c1565b61008c565b005b604051631759616b60e11b81526001600160a01b038b1690632eb2c2d6906100c69033908d908d908d908d908d908d908d90600401610404565b600060405180830381600087803b1580156100e057600080fd5b505af11580156100f4573d6000803e3d6000fd5b50505050600061010c8b338b8b8b8b8b8b8b8b6101ae565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061015d908d90859060040161048c565b6020604051808303816000875af115801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a091906104ce565b505050505050505050505050565b6060600089898989898989896040516020016101d19897969594939291906104e7565b60405160208183030381529060405290508b8b826040516020016101f793929190610538565b6040516020818303038152906040529150509a9950505050505050505050565b80356001600160a01b038116811461022e57600080fd5b919050565b60008083601f84011261024557600080fd5b50813567ffffffffffffffff81111561025d57600080fd5b6020830191508360208260051b850101111561027857600080fd5b9250929050565b60008083601f84011261029157600080fd5b50813567ffffffffffffffff8111156102a957600080fd5b60208301915083602082850101111561027857600080fd5b60008060008060008060008060008060c08b8d0312156102e057600080fd5b6102e98b610217565b99506102f760208c01610217565b985060408b013567ffffffffffffffff8082111561031457600080fd5b6103208e838f01610233565b909a50985060608d013591508082111561033957600080fd5b6103458e838f01610233565b909850965060808d013591508082111561035e57600080fd5b61036a8e838f0161027f565b909650945060a08d013591508082111561038357600080fd5b506103908d828e0161027f565b915080935050809150509295989b9194979a5092959850565b81835260006001600160fb1b038311156103c257600080fd5b8260051b80836020870137939093016020019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682528816602082015260a060408201819052600090610431908301888a6103a9565b82810360608401526104448187896103a9565b905082810360808401526104598185876103db565b9b9a5050505050505050505050565b60005b8381101561048357818101518382015260200161046b565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526104b9816060850160208701610468565b601f01601f1916919091016060019392505050565b6000602082840312156104e057600080fd5b5051919050565b6080815260006104fb608083018a8c6103a9565b828103602084015261050e81898b6103a9565b905082810360408401526105238187896103db565b905082810360608401526104598185876103db565b60006bffffffffffffffffffffffff19808660601b168352808560601b16601484015250825161056f816028850160208701610468565b9190910160280194935050505056fea2646970667358221220c9c57340b796a6b584a1c7cd5626454bf644acddc137079f21699cf784a1063264736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806324d15c6714610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a6100853660046102c1565b61008c565b005b604051631759616b60e11b81526001600160a01b038b1690632eb2c2d6906100c69033908d908d908d908d908d908d908d90600401610404565b600060405180830381600087803b1580156100e057600080fd5b505af11580156100f4573d6000803e3d6000fd5b50505050600061010c8b338b8b8b8b8b8b8b8b6101ae565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061015d908d90859060040161048c565b6020604051808303816000875af115801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a091906104ce565b505050505050505050505050565b6060600089898989898989896040516020016101d19897969594939291906104e7565b60405160208183030381529060405290508b8b826040516020016101f793929190610538565b6040516020818303038152906040529150509a9950505050505050505050565b80356001600160a01b038116811461022e57600080fd5b919050565b60008083601f84011261024557600080fd5b50813567ffffffffffffffff81111561025d57600080fd5b6020830191508360208260051b850101111561027857600080fd5b9250929050565b60008083601f84011261029157600080fd5b50813567ffffffffffffffff8111156102a957600080fd5b60208301915083602082850101111561027857600080fd5b60008060008060008060008060008060c08b8d0312156102e057600080fd5b6102e98b610217565b99506102f760208c01610217565b985060408b013567ffffffffffffffff8082111561031457600080fd5b6103208e838f01610233565b909a50985060608d013591508082111561033957600080fd5b6103458e838f01610233565b909850965060808d013591508082111561035e57600080fd5b61036a8e838f0161027f565b909650945060a08d013591508082111561038357600080fd5b506103908d828e0161027f565b915080935050809150509295989b9194979a5092959850565b81835260006001600160fb1b038311156103c257600080fd5b8260051b80836020870137939093016020019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682528816602082015260a060408201819052600090610431908301888a6103a9565b82810360608401526104448187896103a9565b905082810360808401526104598185876103db565b9b9a5050505050505050505050565b60005b8381101561048357818101518382015260200161046b565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526104b9816060850160208701610468565b601f01601f1916919091016060019392505050565b6000602082840312156104e057600080fd5b5051919050565b6080815260006104fb608083018a8c6103a9565b828103602084015261050e81898b6103a9565b905082810360408401526105238187896103db565b905082810360608401526104598185876103db565b60006bffffffffffffffffffffffff19808660601b168352808560601b16601484015250825161056f816028850160208701610468565b9190910160280194935050505056fea2646970667358221220c9c57340b796a6b584a1c7cd5626454bf644acddc137079f21699cf784a1063264736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the portal" - } - }, - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": { - "details": "Please make sure `_tokenIds` and `_values` have the same length.", - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-1155 token contract", - "_tokenIds": "The identifiers of the tokens being transferred", - "_values": "Transfer amounts per token type" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-1155 Batch Transfer Portal", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the portal." - }, - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": { - "notice": "Transfer a batch of ERC-1155 tokens to a DApp and add an input to the DApp's input box to signal such operation. The caller must enable approval for the portal to manage all of their tokens beforehand, by calling the `setApprovalForAll` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract allows anyone to perform batch transfers of ERC-1155 tokens to a DApp while informing the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "292000", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": "infinite", - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": "24d15c67", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/ERC1155SinglePortal.sol/ERC1155SinglePortal.json b/onchain/rollups/export/artifacts/contracts/portals/ERC1155SinglePortal.sol/ERC1155SinglePortal.json deleted file mode 100644 index e2f452b22..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/ERC1155SinglePortal.sol/ERC1155SinglePortal.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "contractName": "ERC1155SinglePortal", - "sourceName": "contracts/portals/ERC1155SinglePortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "contract IERC1155", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositSingleERC1155Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b5060405161054e38038061054e83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516104bd61009160003960008181603c015261012001526104bd6000f3fe608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a578063dec07dca14610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a61008536600461026a565b61008c565b005b604051637921219560e11b81526001600160a01b0389169063f242432a906100c29033908b908b908b908b908b9060040161033b565b600060405180830381600087803b1580156100dc57600080fd5b505af11580156100f0573d6000803e3d6000fd5b50505050600061010689338989898989896101a6565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd6390610157908b9085906004016103a6565b6020604051808303816000875af1158015610176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019a91906103e8565b50505050505050505050565b60606000858585856040516020016101c19493929190610401565b604051602081830303815290604052905089898989846040516020016101eb959493929190610433565b60405160208183030381529060405291505098975050505050505050565b6001600160a01b038116811461021e57600080fd5b50565b60008083601f84011261023357600080fd5b50813567ffffffffffffffff81111561024b57600080fd5b60208301915083602082850101111561026357600080fd5b9250929050565b60008060008060008060008060c0898b03121561028657600080fd5b883561029181610209565b975060208901356102a181610209565b96506040890135955060608901359450608089013567ffffffffffffffff808211156102cc57600080fd5b6102d88c838d01610221565b909650945060a08b01359150808211156102f157600080fd5b506102fe8b828c01610221565b999c989b5096995094979396929594505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190526000906103769083018486610312565b98975050505050505050565b60005b8381101561039d578181015183820152602001610385565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526103d3816060850160208701610382565b601f01601f1916919091016060019392505050565b6000602082840312156103fa57600080fd5b5051919050565b604081526000610415604083018688610312565b8281036020840152610428818587610312565b979650505050505050565b60006bffffffffffffffffffffffff19808860601b168352808760601b166014840152508460288301528360488301528251610476816068850160208701610382565b91909101606801969550505050505056fea264697066735822122084156a5ce8a5fbfc98de91ca955ed0d7ef43230ac3346ebdc0ccaccfb2f2ad7764736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a578063dec07dca14610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a61008536600461026a565b61008c565b005b604051637921219560e11b81526001600160a01b0389169063f242432a906100c29033908b908b908b908b908b9060040161033b565b600060405180830381600087803b1580156100dc57600080fd5b505af11580156100f0573d6000803e3d6000fd5b50505050600061010689338989898989896101a6565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd6390610157908b9085906004016103a6565b6020604051808303816000875af1158015610176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019a91906103e8565b50505050505050505050565b60606000858585856040516020016101c19493929190610401565b604051602081830303815290604052905089898989846040516020016101eb959493929190610433565b60405160208183030381529060405291505098975050505050505050565b6001600160a01b038116811461021e57600080fd5b50565b60008083601f84011261023357600080fd5b50813567ffffffffffffffff81111561024b57600080fd5b60208301915083602082850101111561026357600080fd5b9250929050565b60008060008060008060008060c0898b03121561028657600080fd5b883561029181610209565b975060208901356102a181610209565b96506040890135955060608901359450608089013567ffffffffffffffff808211156102cc57600080fd5b6102d88c838d01610221565b909650945060a08b01359150808211156102f157600080fd5b506102fe8b828c01610221565b999c989b5096995094979396929594505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190526000906103769083018486610312565b98975050505050505050565b60005b8381101561039d578181015183820152602001610385565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526103d3816060850160208701610382565b601f01601f1916919091016060019392505050565b6000602082840312156103fa57600080fd5b5051919050565b604081526000610415604083018688610312565b8281036020840152610428818587610312565b979650505050505050565b60006bffffffffffffffffffffffff19808860601b168352808760601b166014840152508460288301528360488301528251610476816068850160208701610382565b91909101606801969550505050505056fea264697066735822122084156a5ce8a5fbfc98de91ca955ed0d7ef43230ac3346ebdc0ccaccfb2f2ad7764736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the portal" - } - }, - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": { - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-1155 token contract", - "_tokenId": "The identifier of the token being transferred", - "_value": "Transfer amount" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-1155 Single Transfer Portal", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the portal." - }, - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": { - "notice": "Transfer an ERC-1155 token to a DApp and add an input to the DApp's input box to signal such operation. The caller must enable approval for the portal to manage all of their tokens beforehand, by calling the `setApprovalForAll` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract allows anyone to perform single transfers of ERC-1155 tokens to a DApp while informing the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "242600", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": "infinite", - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": "dec07dca", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/ERC20Portal.sol/ERC20Portal.json b/onchain/rollups/export/artifacts/contracts/portals/ERC20Portal.sol/ERC20Portal.json deleted file mode 100644 index 6421ee1e2..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/ERC20Portal.sol/ERC20Portal.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "contractName": "ERC20Portal", - "sourceName": "contracts/portals/ERC20Portal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b5060405161045f38038061045f83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516103ce61009160003960008181603c015261013501526103ce6000f3fe608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806395854b8114610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a610085366004610209565b61008c565b005b6040516323b872dd60e01b81523360048201526001600160a01b03858116602483015260448201859052600091908716906323b872dd906064016020604051808303816000875af11580156100e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010991906102a8565b9050600061011b8288338888886101b9565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061016c90899085906004016102d1565b6020604051808303816000875af115801561018b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101af919061032f565b5050505050505050565b60608686868686866040516020016101d696959493929190610348565b60405160208183030381529060405290509695505050505050565b6001600160a01b038116811461020657600080fd5b50565b60008060008060006080868803121561022157600080fd5b853561022c816101f1565b9450602086013561023c816101f1565b935060408601359250606086013567ffffffffffffffff8082111561026057600080fd5b818801915088601f83011261027457600080fd5b81358181111561028357600080fd5b89602082850101111561029557600080fd5b9699959850939650602001949392505050565b6000602082840312156102ba57600080fd5b815180151581146102ca57600080fd5b9392505050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561030d578581018301518582016060015282016102f1565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561034157600080fd5b5051919050565b86151560f81b815260006bffffffffffffffffffffffff19808860601b166001840152808760601b166015840152508460298301528284604984013750600091016049019081529594505050505056fea264697066735822122082a0be87dd414c83ef057cb1487968a06d3777c5692f2d7e0da6d74cbc456ea864736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806395854b8114610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a610085366004610209565b61008c565b005b6040516323b872dd60e01b81523360048201526001600160a01b03858116602483015260448201859052600091908716906323b872dd906064016020604051808303816000875af11580156100e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010991906102a8565b9050600061011b8288338888886101b9565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061016c90899085906004016102d1565b6020604051808303816000875af115801561018b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101af919061032f565b5050505050505050565b60608686868686866040516020016101d696959493929190610348565b60405160208183030381529060405290509695505050505050565b6001600160a01b038116811461020657600080fd5b50565b60008060008060006080868803121561022157600080fd5b853561022c816101f1565b9450602086013561023c816101f1565b935060408601359250606086013567ffffffffffffffff8082111561026057600080fd5b818801915088601f83011261027457600080fd5b81358181111561028357600080fd5b89602082850101111561029557600080fd5b9699959850939650602001949392505050565b6000602082840312156102ba57600080fd5b815180151581146102ca57600080fd5b9392505050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561030d578581018301518582016060015282016102f1565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561034157600080fd5b5051919050565b86151560f81b815260006bffffffffffffffffffffffff19808860601b166001840152808760601b166015840152508460298301528284604984013750600091016049019081529594505050505056fea264697066735822122082a0be87dd414c83ef057cb1487968a06d3777c5692f2d7e0da6d74cbc456ea864736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the portal" - } - }, - "depositERC20Tokens(address,address,uint256,bytes)": { - "params": { - "_amount": "The amount of tokens to be transferred", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-20 token contract" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-20 Portal", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the portal." - }, - "depositERC20Tokens(address,address,uint256,bytes)": { - "notice": "Transfer ERC-20 tokens to a DApp and add an input to the DApp's input box to signal such operation. The caller must allow the portal to withdraw at least `_amount` tokens from their account beforehand, by calling the `approve` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract allows anyone to perform transfers of ERC-20 tokens to a DApp while informing the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "194800", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "depositERC20Tokens(address,address,uint256,bytes)": "infinite", - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "depositERC20Tokens(address,address,uint256,bytes)": "95854b81", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/ERC721Portal.sol/ERC721Portal.json b/onchain/rollups/export/artifacts/contracts/portals/ERC721Portal.sol/ERC721Portal.json deleted file mode 100644 index aae6fcdc0..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/ERC721Portal.sol/ERC721Portal.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "contractName": "ERC721Portal", - "sourceName": "contracts/portals/ERC721Portal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "contract IERC721", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositERC721Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b5060405161052438038061052483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161049361009160003960008181603c015261011d01526104936000f3fe608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806328911e8314610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a610085366004610263565b61008c565b005b604051635c46a7ef60e11b81526001600160a01b0388169063b88d4fde906100c09033908a908a908a908a9060040161032b565b600060405180830381600087803b1580156100da57600080fd5b505af11580156100ee573d6000803e3d6000fd5b505050506000610103883388888888886101a2565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd6390610154908a90859060040161038e565b6020604051808303816000875af1158015610173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019791906103d0565b505050505050505050565b60606000858585856040516020016101bd94939291906103e9565b6040516020818303038152906040529050888888836040516020016101e59493929190610410565b604051602081830303815290604052915050979650505050505050565b6001600160a01b038116811461021757600080fd5b50565b60008083601f84011261022c57600080fd5b50813567ffffffffffffffff81111561024457600080fd5b60208301915083602082850101111561025c57600080fd5b9250929050565b600080600080600080600060a0888a03121561027e57600080fd5b873561028981610202565b9650602088013561029981610202565b955060408801359450606088013567ffffffffffffffff808211156102bd57600080fd5b6102c98b838c0161021a565b909650945060808a01359150808211156102e257600080fd5b506102ef8a828b0161021a565b989b979a50959850939692959293505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038681168252851660208201526040810184905260806060820181905260009061035f9083018486610302565b979650505050505050565b60005b8381101561038557818101518382015260200161036d565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526103bb81606085016020870161036a565b601f01601f1916919091016060019392505050565b6000602082840312156103e257600080fd5b5051919050565b6040815260006103fd604083018688610302565b828103602084015261035f818587610302565b60006bffffffffffffffffffffffff19808760601b168352808660601b16601484015250836028830152825161044d81604885016020870161036a565b919091016048019594505050505056fea2646970667358221220963d2a6a38e800c0a3ba04759b9e7c546f6e440dac437e91d4405ca2785c10ff64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a57806328911e8314610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a610085366004610263565b61008c565b005b604051635c46a7ef60e11b81526001600160a01b0388169063b88d4fde906100c09033908a908a908a908a9060040161032b565b600060405180830381600087803b1580156100da57600080fd5b505af11580156100ee573d6000803e3d6000fd5b505050506000610103883388888888886101a2565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd6390610154908a90859060040161038e565b6020604051808303816000875af1158015610173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019791906103d0565b505050505050505050565b60606000858585856040516020016101bd94939291906103e9565b6040516020818303038152906040529050888888836040516020016101e59493929190610410565b604051602081830303815290604052915050979650505050505050565b6001600160a01b038116811461021757600080fd5b50565b60008083601f84011261022c57600080fd5b50813567ffffffffffffffff81111561024457600080fd5b60208301915083602082850101111561025c57600080fd5b9250929050565b600080600080600080600060a0888a03121561027e57600080fd5b873561028981610202565b9650602088013561029981610202565b955060408801359450606088013567ffffffffffffffff808211156102bd57600080fd5b6102c98b838c0161021a565b909650945060808a01359150808211156102e257600080fd5b506102ef8a828b0161021a565b989b979a50959850939692959293505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038681168252851660208201526040810184905260806060820181905260009061035f9083018486610302565b979650505050505050565b60005b8381101561038557818101518382015260200161036d565b50506000910152565b60018060a01b038316815260406020820152600082518060408401526103bb81606085016020870161036a565b601f01601f1916919091016060019392505050565b6000602082840312156103e257600080fd5b5051919050565b6040815260006103fd604083018688610302565b828103602084015261035f818587610302565b60006bffffffffffffffffffffffff19808760601b168352808660601b16601484015250836028830152825161044d81604885016020870161036a565b919091016048019594505050505056fea2646970667358221220963d2a6a38e800c0a3ba04759b9e7c546f6e440dac437e91d4405ca2785c10ff64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the portal" - } - }, - "depositERC721Token(address,address,uint256,bytes,bytes)": { - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-721 token contract", - "_tokenId": "The identifier of the token being transferred" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-721 Portal", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the portal." - }, - "depositERC721Token(address,address,uint256,bytes,bytes)": { - "notice": "Transfer an ERC-721 token to a DApp and add an input to the DApp's input box to signal such operation. The caller must change the approved address for the ERC-721 token to the portal address beforehand, by calling the `approve` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract allows anyone to perform transfers of ERC-721 tokens to a DApp while informing the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "234200", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "depositERC721Token(address,address,uint256,bytes,bytes)": "infinite", - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "depositERC721Token(address,address,uint256,bytes,bytes)": "28911e83", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/EtherPortal.sol/EtherPortal.json b/onchain/rollups/export/artifacts/contracts/portals/EtherPortal.sol/EtherPortal.json deleted file mode 100644 index d403841e3..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/EtherPortal.sol/EtherPortal.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "contractName": "EtherPortal", - "sourceName": "contracts/portals/EtherPortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EtherTransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositEther", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b506040516103de3803806103de83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161034d61009160003960008181603c0152610128015261034d6000f3fe6080604052600436106100285760003560e01c8062aace9a1461002d578063938c054f14610077575b600080fd5b34801561003957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a6100853660046101dc565b61008c565b005b6000836001600160a01b03163460405160006040518083038185875af1925050503d80600081146100d9576040519150601f19603f3d011682016040523d82523d6000602084013e6100de565b606091505b505090508061010057604051630ce8f45160e31b815260040160405180910390fd5b600061010e333486866101aa565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061015f908890859060040161026d565b6020604051808303816000875af115801561017e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a291906102cb565b505050505050565b6060848484846040516020016101c394939291906102e4565b6040516020818303038152906040529050949350505050565b6000806000604084860312156101f157600080fd5b83356001600160a01b038116811461020857600080fd5b9250602084013567ffffffffffffffff8082111561022557600080fd5b818601915086601f83011261023957600080fd5b81358181111561024857600080fd5b87602082850101111561025a57600080fd5b6020830194508093505050509250925092565b60018060a01b038316815260006020604081840152835180604085015260005b818110156102a95785810183015185820160600152820161028d565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156102dd57600080fd5b5051919050565b6bffffffffffffffffffffffff198560601b1681528360148201528183603483013760009101603401908152939250505056fea264697066735822122061a5636c12dd05b943b90c92470347a1823c20f65a4a11350f8d4ed93ab1859a64736f6c63430008130033", - "deployedBytecode": "0x6080604052600436106100285760003560e01c8062aace9a1461002d578063938c054f14610077575b600080fd5b34801561003957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a6100853660046101dc565b61008c565b005b6000836001600160a01b03163460405160006040518083038185875af1925050503d80600081146100d9576040519150601f19603f3d011682016040523d82523d6000602084013e6100de565b606091505b505090508061010057604051630ce8f45160e31b815260040160405180910390fd5b600061010e333486866101aa565b604051631789cd6360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631789cd639061015f908890859060040161026d565b6020604051808303816000875af115801561017e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a291906102cb565b505050505050565b6060848484846040516020016101c394939291906102e4565b6040516020818303038152906040529050949350505050565b6000806000604084860312156101f157600080fd5b83356001600160a01b038116811461020857600080fd5b9250602084013567ffffffffffffffff8082111561022557600080fd5b818601915086601f83011261023957600080fd5b81358181111561024857600080fd5b87602082850101111561025a57600080fd5b6020830194508093505050509250925092565b60018060a01b038316815260006020604081840152835180604085015260005b818110156102a95785810183015185820160600152820161028d565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156102dd57600080fd5b5051919050565b6bffffffffffffffffffffffff198560601b1681528360148201528183603483013760009101603401908152939250505056fea264697066735822122061a5636c12dd05b943b90c92470347a1823c20f65a4a11350f8d4ed93ab1859a64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the portal" - } - }, - "depositEther(address,bytes)": { - "details": "All the value sent through this function is forwarded to the DApp. If the transfer fails, `EtherTransferFailed` error is raised.", - "params": { - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "Ether Portal", - "version": 1 - }, - "userdoc": { - "errors": { - "EtherTransferFailed()": [ - { - "notice": "Raised when the Ether transfer fails." - } - ] - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the portal." - }, - "depositEther(address,bytes)": { - "notice": "Transfer Ether to a DApp and add an input to the DApp's input box to signal such operation. All the value sent through this function is forwarded to the DApp." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "notice": "This contract allows anyone to perform transfers of Ether to a DApp while informing the off-chain machine.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "169000", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "depositEther(address,bytes)": "infinite", - "getInputBox()": "infinite" - } - }, - "methodIdentifiers": { - "depositEther(address,bytes)": "938c054f", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/IERC1155BatchPortal.sol/IERC1155BatchPortal.json b/onchain/rollups/export/artifacts/contracts/portals/IERC1155BatchPortal.sol/IERC1155BatchPortal.json deleted file mode 100644 index f1c954228..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/IERC1155BatchPortal.sol/IERC1155BatchPortal.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "contractName": "IERC1155BatchPortal", - "sourceName": "contracts/portals/IERC1155BatchPortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC1155", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "_tokenIds", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "_values", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositBatchERC1155Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": { - "details": "Please make sure `_tokenIds` and `_values` have the same length.", - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-1155 token contract", - "_tokenIds": "The identifiers of the tokens being transferred", - "_values": "Transfer amounts per token type" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-1155 Batch Transfer Portal interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": { - "notice": "Transfer a batch of ERC-1155 tokens to a DApp and add an input to the DApp's input box to signal such operation. The caller must enable approval for the portal to manage all of their tokens beforehand, by calling the `setApprovalForAll` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "depositBatchERC1155Token(address,address,uint256[],uint256[],bytes,bytes)": "24d15c67", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/IERC1155SinglePortal.sol/IERC1155SinglePortal.json b/onchain/rollups/export/artifacts/contracts/portals/IERC1155SinglePortal.sol/IERC1155SinglePortal.json deleted file mode 100644 index 992bb5d18..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/IERC1155SinglePortal.sol/IERC1155SinglePortal.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "contractName": "IERC1155SinglePortal", - "sourceName": "contracts/portals/IERC1155SinglePortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC1155", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositSingleERC1155Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": { - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-1155 token contract", - "_tokenId": "The identifier of the token being transferred", - "_value": "Transfer amount" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-1155 Single Transfer Portal interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": { - "notice": "Transfer an ERC-1155 token to a DApp and add an input to the DApp's input box to signal such operation. The caller must enable approval for the portal to manage all of their tokens beforehand, by calling the `setApprovalForAll` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "depositSingleERC1155Token(address,address,uint256,uint256,bytes,bytes)": "dec07dca", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/IERC20Portal.sol/IERC20Portal.json b/onchain/rollups/export/artifacts/contracts/portals/IERC20Portal.sol/IERC20Portal.json deleted file mode 100644 index 43244d492..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/IERC20Portal.sol/IERC20Portal.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "contractName": "IERC20Portal", - "sourceName": "contracts/portals/IERC20Portal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "depositERC20Tokens(address,address,uint256,bytes)": { - "params": { - "_amount": "The amount of tokens to be transferred", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-20 token contract" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-20 Portal interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "depositERC20Tokens(address,address,uint256,bytes)": { - "notice": "Transfer ERC-20 tokens to a DApp and add an input to the DApp's input box to signal such operation. The caller must allow the portal to withdraw at least `_amount` tokens from their account beforehand, by calling the `approve` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "depositERC20Tokens(address,address,uint256,bytes)": "95854b81", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/IERC721Portal.sol/IERC721Portal.json b/onchain/rollups/export/artifacts/contracts/portals/IERC721Portal.sol/IERC721Portal.json deleted file mode 100644 index de170a4b2..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/IERC721Portal.sol/IERC721Portal.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "contractName": "IERC721Portal", - "sourceName": "contracts/portals/IERC721Portal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC721", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_baseLayerData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositERC721Token", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "depositERC721Token(address,address,uint256,bytes,bytes)": { - "params": { - "_baseLayerData": "Additional data to be interpreted by the base layer", - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer", - "_token": "The ERC-721 token contract", - "_tokenId": "The identifier of the token being transferred" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "ERC-721 Portal interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "depositERC721Token(address,address,uint256,bytes,bytes)": { - "notice": "Transfer an ERC-721 token to a DApp and add an input to the DApp's input box to signal such operation. The caller must change the approved address for the ERC-721 token to the portal address beforehand, by calling the `approve` function in the token contract." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "depositERC721Token(address,address,uint256,bytes,bytes)": "28911e83", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/portals/IEtherPortal.sol/IEtherPortal.json b/onchain/rollups/export/artifacts/contracts/portals/IEtherPortal.sol/IEtherPortal.json deleted file mode 100644 index 0bcc41449..000000000 --- a/onchain/rollups/export/artifacts/contracts/portals/IEtherPortal.sol/IEtherPortal.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "contractName": "IEtherPortal", - "sourceName": "contracts/portals/IEtherPortal.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_execLayerData", - "type": "bytes" - } - ], - "name": "depositEther", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "depositEther(address,bytes)": { - "details": "All the value sent through this function is forwarded to the DApp. If the transfer fails, `EtherTransferFailed` error is raised.", - "params": { - "_dapp": "The address of the DApp", - "_execLayerData": "Additional data to be interpreted by the execution layer" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - } - }, - "title": "Ether Portal interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "depositEther(address,bytes)": { - "notice": "Transfer Ether to a DApp and add an input to the DApp's input box to signal such operation. All the value sent through this function is forwarded to the DApp." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "depositEther(address,bytes)": "938c054f", - "getInputBox()": "00aace9a" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/relays/DAppAddressRelay.sol/DAppAddressRelay.json b/onchain/rollups/export/artifacts/contracts/relays/DAppAddressRelay.sol/DAppAddressRelay.json deleted file mode 100644 index 0a57b182e..000000000 --- a/onchain/rollups/export/artifacts/contracts/relays/DAppAddressRelay.sol/DAppAddressRelay.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "contractName": "DAppAddressRelay", - "sourceName": "contracts/relays/DAppAddressRelay.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - } - ], - "name": "relayDAppAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60a060405234801561001057600080fd5b506040516102bc3803806102bc83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161022c61009060003960008181603c015260c8015261022c6000f3fe608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a5780633016f49e14610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a61008536600461014f565b61008c565b005b60408051606083901b6bffffffffffffffffffffffff19166020820152815180820360140181526034820192839052631789cd6360e01b9092527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631789cd6390610107908590859060380161017f565b6020604051808303816000875af1158015610126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014a91906101dd565b505050565b60006020828403121561016157600080fd5b81356001600160a01b038116811461017857600080fd5b9392505050565b60018060a01b038316815260006020604081840152835180604085015260005b818110156101bb5785810183015185820160600152820161019f565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156101ef57600080fd5b505191905056fea26469706673582212202ca7ad28494a747ec0481d164da7151ec32dba6023a1b4fa46865fdf922a303164736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100355760003560e01c8062aace9a1461003a5780633016f49e14610077575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006040516001600160a01b03909116815260200160405180910390f35b61008a61008536600461014f565b61008c565b005b60408051606083901b6bffffffffffffffffffffffff19166020820152815180820360140181526034820192839052631789cd6360e01b9092527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631789cd6390610107908590859060380161017f565b6020604051808303816000875af1158015610126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014a91906101dd565b505050565b60006020828403121561016157600080fd5b81356001600160a01b038116811461017857600080fd5b9392505050565b60018060a01b038316815260006020604081840152835180604085015260005b818110156101bb5785810183015185820160600152820161019f565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156101ef57600080fd5b505191905056fea26469706673582212202ca7ad28494a747ec0481d164da7151ec32dba6023a1b4fa46865fdf922a303164736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_inputBox": "The input box used by the relay" - } - }, - "getInputBox()": { - "returns": { - "_0": "The input box" - } - }, - "relayDAppAddress(address)": { - "params": { - "_dapp": "The address of the DApp" - } - } - }, - "title": "DApp Address Relay", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs the relay." - }, - "getInputBox()": { - "notice": "Get the input box used by this input relay." - }, - "relayDAppAddress(address)": { - "notice": "Add an input to a DApp's input box with its address." - } - }, - "notice": "This contract allows anyone to inform the off-chain machine of the address of the DApp contract in a trustless and permissionless way.", - "version": 1 - }, - "evm": { - "gasEstimates": { - "creation": { - "codeDepositCost": "111200", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "external": { - "getInputBox()": "infinite", - "relayDAppAddress(address)": "infinite" - } - }, - "methodIdentifiers": { - "getInputBox()": "00aace9a", - "relayDAppAddress(address)": "3016f49e" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/export/artifacts/contracts/relays/IDAppAddressRelay.sol/IDAppAddressRelay.json b/onchain/rollups/export/artifacts/contracts/relays/IDAppAddressRelay.sol/IDAppAddressRelay.json deleted file mode 100644 index b910d6f32..000000000 --- a/onchain/rollups/export/artifacts/contracts/relays/IDAppAddressRelay.sol/IDAppAddressRelay.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "contractName": "IDAppAddressRelay", - "sourceName": "contracts/relays/IDAppAddressRelay.sol", - "abi": [ - { - "inputs": [], - "name": "getInputBox", - "outputs": [ - { - "internalType": "contract IInputBox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - } - ], - "name": "relayDAppAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "devdoc": { - "kind": "dev", - "methods": { - "getInputBox()": { - "returns": { - "_0": "The input box" - } - }, - "relayDAppAddress(address)": { - "params": { - "_dapp": "The address of the DApp" - } - } - }, - "title": "DApp Address Relay interface", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getInputBox()": { - "notice": "Get the input box used by this input relay." - }, - "relayDAppAddress(address)": { - "notice": "Add an input to a DApp's input box with its address." - } - }, - "version": 1 - }, - "evm": { - "gasEstimates": null, - "methodIdentifiers": { - "getInputBox()": "00aace9a", - "relayDAppAddress(address)": "3016f49e" - } - } -} \ No newline at end of file diff --git a/onchain/rollups/hardhat.config.ts b/onchain/rollups/hardhat.config.ts index 7e8e21cac..9d351648e 100644 --- a/onchain/rollups/hardhat.config.ts +++ b/onchain/rollups/hardhat.config.ts @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) import path from "path"; import { HardhatUserConfig } from "hardhat/config"; diff --git a/onchain/rollups/test/foundry/consensus/authority/Authority.t.sol b/onchain/rollups/test/foundry/consensus/authority/Authority.t.sol index 75199e739..a182e3a38 100644 --- a/onchain/rollups/test/foundry/consensus/authority/Authority.t.sol +++ b/onchain/rollups/test/foundry/consensus/authority/Authority.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Authority Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/dapp/CartesiDApp.t.sol b/onchain/rollups/test/foundry/dapp/CartesiDApp.t.sol index ce3d470fd..77cefe1df 100644 --- a/onchain/rollups/test/foundry/dapp/CartesiDApp.t.sol +++ b/onchain/rollups/test/foundry/dapp/CartesiDApp.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Cartesi DApp Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/dapp/CartesiDAppFactory.t.sol b/onchain/rollups/test/foundry/dapp/CartesiDAppFactory.t.sol index 46e3730c8..96cbf42f1 100644 --- a/onchain/rollups/test/foundry/dapp/CartesiDAppFactory.t.sol +++ b/onchain/rollups/test/foundry/dapp/CartesiDAppFactory.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Cartesi DApp Factory Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/dapp/helper/Dockerfile b/onchain/rollups/test/foundry/dapp/helper/Dockerfile index e12a609c6..76de12675 100755 --- a/onchain/rollups/test/foundry/dapp/helper/Dockerfile +++ b/onchain/rollups/test/foundry/dapp/helper/Dockerfile @@ -1,14 +1,5 @@ -# Copyright Cartesi Pte. Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# (c) Cartesi and individual authors (see AUTHORS) +# SPDX-License-Identifier: Apache-2.0 (see LICENSE) FROM cartesi/server-manager:0.7.0 WORKDIR /opt/gen-proofs diff --git a/onchain/rollups/test/foundry/dapp/helper/genProofLibrary.ts b/onchain/rollups/test/foundry/dapp/helper/genProofLibrary.ts index 801d875e3..dda9a0b6f 100644 --- a/onchain/rollups/test/foundry/dapp/helper/genProofLibrary.ts +++ b/onchain/rollups/test/foundry/dapp/helper/genProofLibrary.ts @@ -1,3 +1,6 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + import { BytesLike } from "@ethersproject/bytes"; import fs from "fs"; import response from "./finish_epoch_response.json"; @@ -73,11 +76,15 @@ function generateLibraryCode( let functionLines: string[] = []; noticeProofs.forEach((noticeProof, index) => { - functionLines.push(generateFunctionCode(noticeProof, `getNotice${index}Proof`)) + functionLines.push( + generateFunctionCode(noticeProof, `getNotice${index}Proof`) + ); }); voucherProofs.forEach((voucherProof, index) => { - functionLines.push(generateFunctionCode(voucherProof, `getVoucher${index}Proof`)) + functionLines.push( + generateFunctionCode(voucherProof, `getVoucher${index}Proof`) + ); }); const lines: string[] = [ @@ -92,7 +99,7 @@ function generateLibraryCode( `library ${libraryName} {`, ...functionLines, "}", - "" + "", ]; return lines.join("\n"); diff --git a/onchain/rollups/test/foundry/dapp/helper/genScript.ts b/onchain/rollups/test/foundry/dapp/helper/genScript.ts index 71247fe20..73978d912 100644 --- a/onchain/rollups/test/foundry/dapp/helper/genScript.ts +++ b/onchain/rollups/test/foundry/dapp/helper/genScript.ts @@ -1,3 +1,6 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + import inputs from "./inputs.json"; import fs from "fs"; @@ -13,18 +16,8 @@ function buildScript(inputArray: Input[]): string { }); const lines: string[] = [ "#!/bin/bash", - "#", - "# Copyright Cartesi Pte. Ltd.", - "#", - '# Licensed under the Apache License, Version 2.0 (the "License"); you may not', - "# use this file except in compliance with the License. You may obtain a copy of", - "# the License at http://www.apache.org/licenses/LICENSE-2.0", - "#", - "# Unless required by applicable law or agreed to in writing, software", - '# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT', - "# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the", - "# License for the specific language governing permissions and limitations under", - "# the License.", + "# (c) Cartesi and individual authors (see AUTHORS)", + "# SPDX-License-Identifier: Apache-2.0 (see LICENSE)", "#", "# THIS FILE WAS AUTOMATICALLY GENERATED BY `genScript.ts`.", "", @@ -103,7 +96,7 @@ function buildScript(inputArray: Input[]): string { " -d '{", ' "session_id": "\'$SESSION_ID\'",', ' "active_epoch_index": 0,', - ' "current_input_index": \'$INPUT_INDEX\',', + " \"current_input_index\": '$INPUT_INDEX',", ' "input_payload": "\'$(echo -n $PAYLOAD | hex_to_base64)\'",', ' "input_metadata": {', ' "msg_sender": {', @@ -112,7 +105,7 @@ function buildScript(inputArray: Input[]): string { ' "block_number": 0,', ' "timestamp": 0,', ' "epoch_index": 0,', - ' "input_index": \'$INPUT_INDEX\'', + " \"input_index\": '$INPUT_INDEX'", " }", " }' \\", " localhost:5001 \\", @@ -142,7 +135,7 @@ function buildScript(inputArray: Input[]): string { " -d '{", ' "session_id": "\'$SESSION_ID\'",', ' "active_epoch_index": 0,', - ' "processed_input_count_within_epoch": \'$((INPUT_INDEX + 1))\',', + " \"processed_input_count_within_epoch\": '$((INPUT_INDEX + 1))',", ' "storage_directory": ""', " }' \\", " localhost:5001 \\", @@ -157,7 +150,7 @@ function buildScript(inputArray: Input[]): string { "do", " if version=`get_version`", " then", - ' [[ `echo "$version" | jq \'.version.major\'` == 0 ]]', + " [[ `echo \"$version\" | jq '.version.major'` == 0 ]]", " break", " fi", "done", @@ -173,7 +166,7 @@ function buildScript(inputArray: Input[]): string { "do", " if epoch_status=`get_epoch_status`", " then", - ' if [ `echo "$epoch_status" | jq \'.pendingInputCount\'` == \'"0"\' ]', + " if [ `echo \"$epoch_status\" | jq '.pendingInputCount'` == '\"0\"' ]", " then", " break", " fi", diff --git a/onchain/rollups/test/foundry/dapp/helper/update-proofs.sh b/onchain/rollups/test/foundry/dapp/helper/update-proofs.sh index e80354eac..6eeaa3089 100755 --- a/onchain/rollups/test/foundry/dapp/helper/update-proofs.sh +++ b/onchain/rollups/test/foundry/dapp/helper/update-proofs.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# (c) Cartesi and individual authors (see AUTHORS) +# SPDX-License-Identifier: Apache-2.0 (see LICENSE) set -euo pipefail diff --git a/onchain/rollups/test/foundry/history/History.t.sol b/onchain/rollups/test/foundry/history/History.t.sol index ec2173631..b6220c09f 100644 --- a/onchain/rollups/test/foundry/history/History.t.sol +++ b/onchain/rollups/test/foundry/history/History.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title History Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/inputs/InputBox.t.sol b/onchain/rollups/test/foundry/inputs/InputBox.t.sol index ec7be51c9..d8902bee6 100644 --- a/onchain/rollups/test/foundry/inputs/InputBox.t.sol +++ b/onchain/rollups/test/foundry/inputs/InputBox.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Input Box Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/portals/ERC1155BatchPortal.t.sol b/onchain/rollups/test/foundry/portals/ERC1155BatchPortal.t.sol index 5bd66d071..c16bd3bd0 100644 --- a/onchain/rollups/test/foundry/portals/ERC1155BatchPortal.t.sol +++ b/onchain/rollups/test/foundry/portals/ERC1155BatchPortal.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title ERC-1155 Batch Transfer Portal Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/portals/ERC1155SinglePortal.t.sol b/onchain/rollups/test/foundry/portals/ERC1155SinglePortal.t.sol index 6de8d9a39..08318bdf0 100644 --- a/onchain/rollups/test/foundry/portals/ERC1155SinglePortal.t.sol +++ b/onchain/rollups/test/foundry/portals/ERC1155SinglePortal.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title ERC-1155 Single Transfer Portal Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/portals/ERC20Portal.t.sol b/onchain/rollups/test/foundry/portals/ERC20Portal.t.sol index 7f0c87329..8fc454e42 100644 --- a/onchain/rollups/test/foundry/portals/ERC20Portal.t.sol +++ b/onchain/rollups/test/foundry/portals/ERC20Portal.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title ERC-20 Portal Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/portals/ERC721Portal.t.sol b/onchain/rollups/test/foundry/portals/ERC721Portal.t.sol index 50a6e41c1..3cd25216c 100644 --- a/onchain/rollups/test/foundry/portals/ERC721Portal.t.sol +++ b/onchain/rollups/test/foundry/portals/ERC721Portal.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title ERC-721 Portal Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/portals/EtherPortal.t.sol b/onchain/rollups/test/foundry/portals/EtherPortal.t.sol index 58fe123d0..90816aba8 100644 --- a/onchain/rollups/test/foundry/portals/EtherPortal.t.sol +++ b/onchain/rollups/test/foundry/portals/EtherPortal.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Ether Portal Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/relays/DAppAddressRelay.t.sol b/onchain/rollups/test/foundry/relays/DAppAddressRelay.t.sol index 2e00742f8..b2f702092 100644 --- a/onchain/rollups/test/foundry/relays/DAppAddressRelay.t.sol +++ b/onchain/rollups/test/foundry/relays/DAppAddressRelay.t.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title DApp Address Relay Test pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/util/SimpleConsensus.sol b/onchain/rollups/test/foundry/util/SimpleConsensus.sol index 7b049462c..2d267b9d1 100644 --- a/onchain/rollups/test/foundry/util/SimpleConsensus.sol +++ b/onchain/rollups/test/foundry/util/SimpleConsensus.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title A Simple Consensus Contract pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/util/SimpleERC20.sol b/onchain/rollups/test/foundry/util/SimpleERC20.sol index 777f00d3a..a604e31d7 100644 --- a/onchain/rollups/test/foundry/util/SimpleERC20.sol +++ b/onchain/rollups/test/foundry/util/SimpleERC20.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title A Simple ERC-20 Contract pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/util/SimpleERC721.sol b/onchain/rollups/test/foundry/util/SimpleERC721.sol index ef64c4062..070dc11ab 100644 --- a/onchain/rollups/test/foundry/util/SimpleERC721.sol +++ b/onchain/rollups/test/foundry/util/SimpleERC721.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title A Simple ERC-721 Contract pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/util/SimpleERC721Receiver.sol b/onchain/rollups/test/foundry/util/SimpleERC721Receiver.sol index 8da8ca697..1d781f3b7 100644 --- a/onchain/rollups/test/foundry/util/SimpleERC721Receiver.sol +++ b/onchain/rollups/test/foundry/util/SimpleERC721Receiver.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title A Simple ERC-721 Receiver Contract pragma solidity ^0.8.8; diff --git a/onchain/rollups/test/foundry/util/TestBase.sol b/onchain/rollups/test/foundry/util/TestBase.sol index b27d20ea5..fd539ba94 100644 --- a/onchain/rollups/test/foundry/util/TestBase.sol +++ b/onchain/rollups/test/foundry/util/TestBase.sol @@ -1,14 +1,5 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) /// @title Test base contract pragma solidity ^0.8.8;