Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #681 from rainprotocol/2023-07-06-rem-store
Browse files Browse the repository at this point in the history
2023 07 06 rem store
  • Loading branch information
thedavidmeister committed Jul 16, 2023
2 parents 51e2358 + c783258 commit 7f0b708
Show file tree
Hide file tree
Showing 145 changed files with 816 additions and 2,943 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell --run 'forge install && ci-deployment mumbai'
- run: nix-shell --run 'forge install --shallow && ci-deployment mumbai'
env:
DEPLOYMENT_KEY_MUMBAI: ${{ secrets.DEPLOYMENT_KEY_MUMBAI }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell --run 'forge install && ci-test'
- run: nix-shell --run 'forge install --shallow && ci-test'
30 changes: 15 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@
[submodule "lib/rain.math.saturating"]
path = lib/rain.math.saturating
url = https://github.com/rainprotocol/rain.math.saturating
[submodule "lib/sol.lib.memory"]
path = lib/sol.lib.memory
url = https://github.com/rainprotocol/sol.lib.memory
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/sol.lib.binmaskflag"]
path = lib/sol.lib.binmaskflag
url = https://github.com/rainprotocol/sol.lib.binmaskflag
[submodule "lib/sol.lib.datacontract"]
path = lib/sol.lib.datacontract
url = https://github.com/rainprotocol/sol.lib.datacontract
[submodule "lib/rain.math.fixedpoint"]
path = lib/rain.math.fixedpoint
url = https://github.com/rainprotocol/rain.math.fixedpoint
[submodule "lib/rain.metadata"]
path = lib/rain.metadata
url = https://github.com/rainprotocol/rain.metadata
[submodule "lib/rain.interpreter"]
path = lib/rain.interpreter
url = https://github.com/rainprotocol/rain.interpreter
[submodule "lib/rain.factory"]
path = lib/rain.factory
url = https://github.com/rainprotocol/rain.factory
[submodule "lib/rain.orderbook"]
path = lib/rain.orderbook
url = https://github.com/rainprotocol/rain.orderbook
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/rain.flow"]
path = lib/rain.flow
url = https://github.com/rainprotocol/rain.flow
[submodule "lib/rain.solmem"]
path = lib/rain.solmem
url = https://github.com/rainprotocol/rain.solmem
[submodule "lib/rain.interpreter"]
path = lib/rain.interpreter
url = https://github.com/rainprotocol/rain.interpreter
[submodule "lib/rain.datacontract"]
path = lib/rain.datacontract
url = https://github.com/rainprotocol/rain.datacontract
[submodule "lib/rain.chainlink"]
path = lib/rain.chainlink
url = https://github.com/rainprotocol/rain.chainlink
37 changes: 0 additions & 37 deletions contracts/chainlink/AggregatorV3Interface.sol

This file was deleted.

62 changes: 0 additions & 62 deletions contracts/chainlink/LibChainlink.sol

This file was deleted.

8 changes: 4 additions & 4 deletions contracts/flow/FlowCommon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import "./libraries/LibFlow.sol";
import "rain.interpreter/interface/IInterpreterCallerV2.sol";
import "rain.interpreter/interface/IExpressionDeployerV1.sol";
import "rain.interpreter/interface/IInterpreterV1.sol";
import "rain.interpreter/lib/LibEncodedDispatch.sol";
import "rain.interpreter/lib/LibContext.sol";
import "rain.interpreter/lib/LibInterpreterState.sol";
import "rain.interpreter/lib/caller/LibEncodedDispatch.sol";
import "rain.interpreter/lib/caller/LibContext.sol";
import "rain.interpreter/lib/state/LibInterpreterState.sol";
import "rain.interpreter/abstract/DeployerDiscoverableMetaV1.sol";
import "rain.interpreter/lib/LibEvaluable.sol";
import "rain.interpreter/lib/caller/LibEvaluable.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {MulticallUpgradeable as Multicall} from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/flow/basic/Flow.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"name": "Dummy Expression",
"abiName": "dummyConfig",
"desc": "A dummy expression. This is here to workaround a bug in Solidity.",
"path": "[12].inputs[1].components[0]"
"path": "[13].inputs[1].components[0]"
},
{
"name": "Flows",
"abiName": "config",
"desc": "The available flows.",
"path": "[12].inputs[1].components[1]",
"path": "[13].inputs[1].components[1]",
"signedContext": true,
"callerContext": true,
"contextColumns": [
Expand Down
15 changes: 8 additions & 7 deletions contracts/flow/basic/Flow.sol
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
// SPDX-License-Identifier: CAL
pragma solidity =0.8.19;

import "rain.factory/interface/ICloneableV1.sol";
import "rain.factory/src/interface/ICloneableV2.sol";
import "../FlowCommon.sol";
import "../libraries/LibFlow.sol";
import "sol.lib.memory/LibUint256Array.sol";
import "sol.lib.memory/LibUint256Matrix.sol";
import "rain.solmem/lib/LibUint256Array.sol";
import "rain.solmem/lib/LibUint256Matrix.sol";
import {ReentrancyGuardUpgradeable as ReentrancyGuard} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

bytes32 constant CALLER_META_HASH = bytes32(
0x3939727b6d233d590e82d29d8e5fef403ddcd96f3ec8a8db3640f5e0a71649a5
0x95de68a447a477b8fab10701f1265b3e85a98b24710b3e40e6a96aa6d76263bc
);

contract Flow is ICloneableV1, IFlowV3, ReentrancyGuard, FlowCommon {
contract Flow is ICloneableV2, IFlowV3, ReentrancyGuard, FlowCommon {
using LibUint256Array for uint256[];
using LibUint256Matrix for uint256[];

constructor(
DeployerDiscoverableMetaV1ConstructionConfig memory config_
) FlowCommon(CALLER_META_HASH, config_) {}

/// @inheritdoc ICloneableV1
function initialize(bytes calldata data_) external initializer {
/// @inheritdoc ICloneableV2
function initialize(bytes calldata data_) external initializer returns (bytes32) {
FlowConfig memory config_ = abi.decode(data_, (FlowConfig));
emit Initialize(msg.sender, config_);

flowCommonInit(config_.config, MIN_FLOW_SENTINELS);
return ICLONEABLE_V2_SUCCESS;
}

function _previewFlow(
Expand Down
6 changes: 3 additions & 3 deletions contracts/flow/erc1155/FlowERC1155.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"name": "URI",
"abiName": "uri",
"desc": "The URI for the ERC1155 token that is minted.",
"path": "[13].inputs[1].components[0]"
"path": "[14].inputs[1].components[0]"
}
],
"expressions": [
{
"name": "Handle transfer",
"abiName": "evaluableConfig",
"desc": "Review and restrict transfers of the flow contract's own ERC1155 token. Mint and burns must be controlled by the flow expressions instead.",
"path": "[13].inputs[1].components[1]",
"path": "[14].inputs[1].components[1]",
"signedContext": false,
"contextColumns": [
{
Expand Down Expand Up @@ -89,7 +89,7 @@
"name": "Flows",
"abiName": "flowConfig",
"desc": "The available flows for this token.",
"path": "[13].inputs[1].components[2]",
"path": "[14].inputs[1].components[2]",
"signedContext": true,
"callerContext": true,
"contextColumns": [
Expand Down
18 changes: 10 additions & 8 deletions contracts/flow/erc1155/FlowERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {ReentrancyGuardUpgradeable as ReentrancyGuard} from "@openzeppelin/contr
import {ERC1155Upgradeable as ERC1155} from "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import {ERC1155ReceiverUpgradeable as ERC1155Receiver} from "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155ReceiverUpgradeable.sol";

import "rain.interpreter/lib/LibEncodedDispatch.sol";
import "rain.factory/interface/ICloneableV1.sol";
import "sol.lib.memory/LibUint256Matrix.sol";
import "rain.interpreter/lib/caller/LibEncodedDispatch.sol";
import "rain.factory/src/interface/ICloneableV2.sol";
import "rain.solmem/lib/LibUint256Matrix.sol";
import "rain.flow/interface/IFlowERC1155V3.sol";

import "sol.lib.memory/LibStackPointer.sol";
import "rain.solmem/lib/LibStackPointer.sol";
import "../libraries/LibFlow.sol";
import "../FlowCommon.sol";

Expand All @@ -19,7 +19,7 @@ Sentinel constant RAIN_FLOW_ERC1155_SENTINEL = Sentinel.wrap(
);

bytes32 constant CALLER_META_HASH = bytes32(
0xaffe4d91de0d0d2a90ea7d6d39abe31a3198bd370f28d4358c0f0d0e40b46248
0x7ea70f837234357ec1bb5b777e04453ebaf3ca778a98805c4bb20a738d559a21
);

SourceIndex constant HANDLE_TRANSFER_ENTRYPOINT = SourceIndex.wrap(0);
Expand All @@ -29,7 +29,7 @@ uint16 constant HANDLE_TRANSFER_MAX_OUTPUTS = 0;
uint256 constant FLOW_ERC1155_MIN_OUTPUTS = MIN_FLOW_SENTINELS + 2;

contract FlowERC1155 is
ICloneableV1,
ICloneableV2,
IFlowERC1155V3,
ReentrancyGuard,
FlowCommon,
Expand All @@ -49,8 +49,8 @@ contract FlowERC1155 is
DeployerDiscoverableMetaV1ConstructionConfig memory config_
) FlowCommon(CALLER_META_HASH, config_) {}

/// @inheritdoc ICloneableV1
function initialize(bytes calldata data_) external initializer {
/// @inheritdoc ICloneableV2
function initialize(bytes calldata data_) external initializer returns (bytes32) {
FlowERC1155Config memory config_ = abi.decode(
data_,
(FlowERC1155Config)
Expand Down Expand Up @@ -81,6 +81,8 @@ contract FlowERC1155 is
);
evaluable = Evaluable(interpreter_, store_, expression_);
}

return ICLONEABLE_V2_SUCCESS;
}

function _dispatchHandleTransfer(
Expand Down
8 changes: 4 additions & 4 deletions contracts/flow/erc20/FlowERC20.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
"name": "Name",
"abiName": "name",
"desc": "Name of the ERC20 token that is minted.",
"path": "[13].inputs[1].components[0]"
"path": "[14].inputs[1].components[0]"
},
{
"name": "Symbol",
"abiName": "symbol",
"desc": "Symbol of the ERC20 token that is minted.",
"path": "[13].inputs[1].components[1]"
"path": "[14].inputs[1].components[1]"
}
],
"expressions": [
{
"name": "Handle Transfer",
"abiName": "evaluableConfig",
"desc": "Review and restrict transfers of the flow contract's own ERC20 token. Mint and burns must be controlled by the flow expressions instead.",
"path": "[13].inputs[1].components[2]",
"path": "[14].inputs[1].components[2]",
"signedContext": false,
"contextColumns": [
{
Expand Down Expand Up @@ -83,7 +83,7 @@
"name": "Flows",
"abiName": "flowConfig",
"desc": "The available flows.",
"path": "[13].inputs[1].components[3]",
"path": "[14].inputs[1].components[3]",
"signedContext": true,
"callerContext": true,
"contextColumns": [
Expand Down
Loading

0 comments on commit 7f0b708

Please sign in to comment.