Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
1097d7c
rain consolidate
NanezX Jun 5, 2022
b5837ff
Merge branch 'master' into 2022-05-31-rain-consolidate-sdk
rouzwelt Jun 13, 2022
94a251a
RainVM 2.0
rouzwelt Jun 18, 2022
f676c1f
Update shell.nix
rouzwelt Jun 18, 2022
c0ce215
fix resolutions deps in lock file
NanezX Jun 19, 2022
54c5fde
remove lock file
NanezX Jun 19, 2022
34f6ea8
new commit
NanezX Jun 19, 2022
984dcc3
remove 0xsequence/sstore2 dep
NanezX Jun 19, 2022
ee3f543
removing old contracts
NanezX Jun 19, 2022
c48ad3d
fix some type errors
NanezX Jun 19, 2022
ee971ac
combine tier args fix
NanezX Jun 19, 2022
5776aff
update opcodes
NanezX Jun 19, 2022
c48634a
update opcodes
NanezX Jun 19, 2022
c16825d
update opcoes and contracts deployed on test
NanezX Jun 19, 2022
0d4b525
fix current tiers
NanezX Jun 19, 2022
54b8da6
remove unneecessary value current tier
NanezX Jun 19, 2022
ac5da0d
mumbai addresses and orderbook opcodes added
NanezX Jun 20, 2022
d60e331
Update for templates, JSVM
rouzwelt Jun 20, 2022
17a7a72
BalanceTier templates
rouzwelt Jun 20, 2022
6b0e9d3
update and some fixes
rouzwelt Jun 21, 2022
fef20da
source friendly generator
NanezX Jun 22, 2022
ae82e4b
Merge branch '2022-06-19-update-rain-consolidate' of https://github.c…
NanezX Jun 22, 2022
340edb5
fix doc generation
NanezX Jun 22, 2022
2b410a8
some updates and debugs
rouzwelt Jun 22, 2022
89b1a59
Merge branch 'v2.x' into 2022-06-19-update-rain-consolidate
rouzwelt Jun 22, 2022
0d72f7b
Merge pull request #15 from beehive-innovation/2022-06-19-update-rain…
rouzwelt Jun 22, 2022
46f5b2e
Merge pull request #16 from beehive-innovation/v2.x
rouzwelt Jun 22, 2022
b347945
- Fixed issue with Eslint that disallowed run it
NanezX Jun 23, 2022
979335d
- Fixed issue with eslint that disallowed run it.
NanezX Jun 23, 2022
d44e786
Merge pull request #17 from beehive-innovation/v2.x
rouzwelt Jul 4, 2022
607855d
missinfix source friendly
NanezX Jul 4, 2022
8513ad5
VM Simulation + MatchMaker + some fixes
rouzwelt Jul 5, 2022
608bcfb
new template functions
rouzwelt Jul 6, 2022
f6a625a
Update vm.ts
rouzwelt Jul 6, 2022
17e1c57
increasing-decreasing price template
rouzwelt Jul 7, 2022
6886b67
Update saleScriptGenerator.ts
rouzwelt Jul 7, 2022
77ac2b7
fix tests
rouzwelt Jul 7, 2022
d3e0624
ERC20 with faucet template + toFixed fix
rouzwelt Jul 9, 2022
49ab0ea
Update for VM tier methods
rouzwelt Jul 10, 2022
e98cc79
Update vm.ts
rouzwelt Jul 10, 2022
5d80086
Update vm.ts
rouzwelt Jul 10, 2022
6c98c0c
Merge pull request #20 from beehive-innovation/sdk-develope-consolidate
rouzwelt Jul 10, 2022
3919a31
still fix on friendly source
NanezX Jul 12, 2022
d1ecd29
Merge branch 'sdk-develope-consolidate' of https://github.com/beehive…
NanezX Jul 12, 2022
ac32c68
stake test
rouzwelt Jul 13, 2022
29eb199
fix source generator
NanezX Jul 13, 2022
d19bc9d
Merge branch 'sdk-develope-consolidate' of https://github.com/beehive…
NanezX Jul 13, 2022
3c4336b
upgrade for SDK
rouzwelt Jul 14, 2022
466e1f0
Merge pull request #23 from beehive-innovation/sdk-develope-consolidate
rouzwelt Jul 14, 2022
1432557
upgrading version
rouzwelt Jul 14, 2022
26ef257
replacing tierContract with ITierV2
rouzwelt Jul 14, 2022
467858c
upgrading version
rouzwelt Jul 14, 2022
cb17694
Merge pull request #24 from beehive-innovation/v2.x
rouzwelt Jul 14, 2022
961a899
snapshot for ERC20 class
rouzwelt Jul 14, 2022
0ee4114
Update RainJS.ts
rouzwelt Jul 14, 2022
9e08364
Merge pull request #25 from beehive-innovation/sdk-develope-consolidate
rouzwelt Jul 14, 2022
d9eb2bc
rearrange and refactor jsvm
rouzwelt Jul 19, 2022
66a7c69
update human friendly read
rouzwelt Jul 19, 2022
dfef029
OpMeta
rouzwelt Jul 19, 2022
bb7b03f
fix for docs generation
rouzwelt Jul 19, 2022
504848e
update docs
rouzwelt Jul 19, 2022
28e3ac3
Upgrades, SeedDance and AutoApprove
rouzwelt Jul 23, 2022
d61f0e7
Update addresses.ts
rouzwelt Jul 23, 2022
723aaf7
Update vm.ts
rouzwelt Jul 23, 2022
7e6ecdf
Update vm.ts
rouzwelt Jul 23, 2022
9bc231f
Update vm.ts
rouzwelt Jul 23, 2022
0107235
Update vm.ts
rouzwelt Jul 23, 2022
a25a209
update
rouzwelt Jul 27, 2022
7b1b247
stack reassignment for vm methods
rouzwelt Jul 27, 2022
28e0746
Update vm.ts
rouzwelt Jul 27, 2022
6e85212
added RuleBuilder
rouzwelt Jul 29, 2022
e51e3e3
Update combineTierScriptGenerator.ts
rouzwelt Jul 29, 2022
9de2a86
update
rouzwelt Jul 29, 2022
41c345b
update
rouzwelt Jul 30, 2022
199b26a
update
rouzwelt Jul 30, 2022
0f07d78
update
rouzwelt Jul 30, 2022
e438f12
update
rouzwelt Jul 30, 2022
b209336
update RuleBuilder
rouzwelt Jul 30, 2022
018789d
update index.ts and docs
rouzwelt Jul 30, 2022
550b34f
update
rouzwelt Jul 31, 2022
584d67a
update
rouzwelt Jul 31, 2022
36183c7
update
rouzwelt Jul 31, 2022
dc5a5ba
debug and fix for critical issue of VM.combiner
rouzwelt Aug 1, 2022
9ad4a37
update
rouzwelt Aug 1, 2022
0d9374f
making super call the first line in the constructor for iTierV2 class
hardyjosh Aug 1, 2022
08a2e8c
moving super calls
hardyjosh Aug 1, 2022
79650cd
Revert "moving super calls"
hardyjosh Aug 1, 2022
ca8908e
RuleBuilder full version
rouzwelt Aug 5, 2022
ea0baf7
update
rouzwelt Aug 6, 2022
63f7baf
fix doc
rouzwelt Aug 6, 2022
b96f783
RuleBuilder debugg, update
rouzwelt Aug 8, 2022
608a3a1
expandable HumanFriendlyRead
rouzwelt Aug 9, 2022
4bde9da
Update HumanFreindlyRead.ts
rouzwelt Aug 9, 2022
a129e99
update
rouzwelt Aug 9, 2022
9b3b073
Update RuleBuilder.test.ts
rouzwelt Aug 9, 2022
7040b6e
optional CONTEXT/STORAGE op name for HumanFriendly
rouzwelt Aug 9, 2022
6b52a0b
HumanFriendlyRead V2
rouzwelt Aug 10, 2022
2cb11fa
HumanFriendly optional aliases fix
rouzwelt Aug 10, 2022
56c93ba
GTE and LTE for HumanFriendlySource
rouzwelt Aug 10, 2022
66892c1
Update HumanFreindlyRead.ts
rouzwelt Aug 10, 2022
e6d06bb
HumanFriendlyRead zipmap showcase update
rouzwelt Aug 11, 2022
8dc4ea0
fix
rouzwelt Aug 11, 2022
70e6ae6
update
rouzwelt Aug 11, 2022
5d2265e
update
rouzwelt Aug 11, 2022
cca35e7
Update ruleBuilder.ts
rouzwelt Aug 11, 2022
eed330d
update
rouzwelt Aug 11, 2022
3e8de72
fix for jsvm ops
rouzwelt Aug 12, 2022
c7cb1da
update rule builder
rouzwelt Aug 12, 2022
30336bd
RuleBuilder strict typechecking
rouzwelt Aug 15, 2022
ce46690
update
rouzwelt Aug 15, 2022
f973e5b
RuleBuilder JSVM evaluation
rouzwelt Aug 16, 2022
275c1a0
fix for jsvm storage ops "this" bound
rouzwelt Aug 16, 2022
82be8af
debug RuleBuilder JSVM
rouzwelt Aug 17, 2022
4913c58
fix
rouzwelt Aug 17, 2022
34755e8
update rulebuilder quantity defaulting
rouzwelt Aug 17, 2022
1f75fd8
fix RuleBuilder eval
rouzwelt Aug 26, 2022
b94f8ae
fix super call issue when built
NanezX Sep 2, 2022
c98bf06
Merge pull request #32 from beehive-innovation/2022-09-01-fix-built-s…
NanezX Sep 2, 2022
a083881
erc20 balance tier workaround
rouzwelt Sep 5, 2022
690704a
Update combineTierScriptGenerator.ts
rouzwelt Sep 5, 2022
4e43f55
debug
rouzwelt Sep 5, 2022
9b76aa3
Parser
rouzwelt Sep 19, 2022
0ccda88
fix curly brackets positions
rouzwelt Sep 20, 2022
cb0f52e
Update parser.ts
rouzwelt Sep 21, 2022
dd4ad79
Update OpMeta.ts
rouzwelt Sep 22, 2022
469c6bd
Update parser.ts
rouzwelt Sep 22, 2022
f4279a1
goerli contracts and sg
rouzwelt Sep 26, 2022
a1633af
opmeta aliases + fix parser
rouzwelt Oct 3, 2022
1d8815c
Update parser.ts
rouzwelt Oct 3, 2022
8a5416a
new commit to fix stake - sdk temp
NanezX Oct 6, 2022
ad9c43a
upadte stake address
NanezX Oct 7, 2022
4e1449b
Merge pull request #33 from beehive-innovation/2022-10-5-new-commit-f…
NanezX Oct 7, 2022
11e6904
updating version tag
NanezX Oct 9, 2022
17be1b0
parser refactor
rouzwelt Oct 14, 2022
606862c
Update parser.ts
rouzwelt Oct 14, 2022
f6710e6
added LTE/GTE and letters case insensitivity
rouzwelt Oct 15, 2022
e863e42
added INEQ parser op + opmeta data
rouzwelt Oct 17, 2022
7d4687e
Update OpMeta.ts
rouzwelt Oct 18, 2022
f68e5de
debug parser infix notation
rouzwelt Oct 18, 2022
27fbceb
update formatter test
rouzwelt Oct 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Deps
node_modules

## Hardhat
artifacts
cache
contracts
dist
typechain
/src/typechain
rule-builder
7 changes: 2 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
module.exports = {
extends: [
'react-app',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
ignorePatterns: ['./src/typechain/*'],
extends: ['react-app'],
settings: {
react: {
version: '999.999.999',
Expand Down
3 changes: 3 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
*/
"extractorMessageReporting": {
"ae-wrong-input-file-type": {
"logLevel": "none"
},
"default": {
"logLevel": "warning"
// "addToApiReportFile": true
Expand Down
254 changes: 254 additions & 0 deletions docs/classes/autoapprove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@

# Class AutoApprove

A class for calling method on a Rain AutoApprove contract.

This class provides an easy way to interact with the AutoApprove contract.

<b>Signature:</b>

```typescript
class AutoApprove extends FactoryContract
```

## Example


```typescript
import { AutoApprove } from 'rain-sdk'

// To deploy a new AutoApprove, pass an ethers.js Signer and the config for the AutoApprove.
const newAutoApprove = await AutoApprove.deploy(signer, stateConfig)

// To connect to an existing AutoApprove just pass the address and an ethers.js Signer.
const existingAutoApprove = new AutoApprove(address, signer)

```

## Static Properties

| Property | Type | Description |
| --- | --- | --- |
| [deploy](./autoapprove.md#deploy-property-static) | `(signer: Signer, autoApproveConfig: StateConfig, overrides?: TxOverrides) => Promise<AutoApprove>` | Deploys a new AutoApprove. |
| [getAddressesForChainId](./addressbook.md#getAddressesForChainId-property-static) | `(chainId: number) => Addresses` | Obtain all the addresses deployed in a specific network with a chain ID.<br></br>*Inherited from [AddressBook.getAddressesForChainId](./addressbook.md#getAddressesForChainId-property-static)* |
| [getChainId](./raincontract.md#getChainId-property-static) | `(signerOrProvider: Signer \| Provider) => Promise<number>` | Get the chain ID from a valid ethers provider.<br></br>Request to the provider stored in the signer which is the chain ID.<br></br>*Inherited from [RainContract.getChainId](./raincontract.md#getChainId-property-static)* |
| [getSubgraphEndpoint](./addressbook.md#getSubgraphEndpoint-property-static) | `(chainId: number) => string` | Obtain the latest subgraph endpoint related to the version that use the SDK.<br></br>*Inherited from [AddressBook.getSubgraphEndpoint](./addressbook.md#getSubgraphEndpoint-property-static)* |
| [isChild](./autoapprove.md#isChild-property-static) | `(signer: Signer, maybeChild: string) => Promise<boolean>` | Checks if address is registered as a child contract of this AutoApproveFactory on a specific network |
| [nameBookReference](./autoapprove.md#nameBookReference-property-static) | `string` | Name reference to find the address of the contract in the book address.<br></br>*Overrides [RainContract.nameBookReference](./raincontract.md#nameBookReference-property-static)* |
| [Opcodes](./autoapprove.md#Opcodes-property-static) | [AutoApproveOps](../types/autoapproveops.md) | All the opcodes avaialbles in the AutoApprove contract. |

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [address](./raincontract.md#address-property) | `string` | The contract address of the instance.<br></br>*Inherited from [RainContract.address](./raincontract.md#address-property)* |
| [afterAdd](./autoapprove.md#afterAdd-property) | <pre>(arg0: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |
| [afterApprove](./autoapprove.md#afterApprove-property) | <pre>(approver_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |
| [afterBan](./autoapprove.md#afterBan-property) | <pre>(banner_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |
| [afterRemove](./autoapprove.md#afterRemove-property) | <pre>(remover_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |
| [connect](./autoapprove.md#connect-property) | `(signer: Signer) => AutoApprove` | Connect to this AutoApprove instance with a new signer<br></br>*Overrides [RainContract.connect](./raincontract.md#connect-property)* |
| [owner](./autoapprove.md#owner-property) | `(overrides?: ReadTxOverrides) => Promise<string>` | |
| [packedFunctionPointers](./autoapprove.md#packedFunctionPointers-property) | `(overrides?: ReadTxOverrides) => Promise<string>` | Pointers to opcode functions, necessary for being able to read the packedBytes |
| [renounceOwnership](./autoapprove.md#renounceOwnership-property) | <pre>(overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |
| [signer](./raincontract.md#signer-property) | `Signer` | The ethers signer that is connected to the instance.<br></br>*Inherited from [RainContract.signer](./raincontract.md#signer-property)* |
| [storageOpcodesRange](./autoapprove.md#storageOpcodesRange-property) | `(overrides?: ReadTxOverrides) => Promise<StorageOpcodesRange>` | Returns the pointer and length for AutoApprove's storage opcodes |
| [transferOwnership](./autoapprove.md#transferOwnership-property) | <pre>(newOwner: string, overrides?: TxOverrides & {&#010; from?: string \| Promise<string>;&#010;}) => Promise<ContractTransaction></pre> | |

## Static Methods

| Method | Description |
| --- | --- |
| [\_isChild(signer, maybeChild)](./factorycontract.md#_isChild-method-static-1) | Checks if address is registered as a child contract of the factory in the chain.<br></br>*Inherited from [FactoryContract.\_isChild()](./factorycontract.md#_isChild-method-static-1)* |
| [getBookAddress(chainId)](./raincontract.md#getBookAddress-method-static-1) | Get the address stored in the book for a determined chain if it is available.<br></br>*Inherited from [RainContract.getBookAddress()](./raincontract.md#getBookAddress-method-static-1)* |
| [getNewChildFromReceipt(receipt, parentContract)](./factorycontract.md#getNewChildFromReceipt-method-static-1) | Get the child from a receipt obtain from a Factory transaction<br></br>*Inherited from [FactoryContract.getNewChildFromReceipt()](./factorycontract.md#getNewChildFromReceipt-method-static-1)* |

## Methods

| Method | Description |
| --- | --- |
| [checkAddress(address, message)](./raincontract.md#checkAddress-method-1) | Check if an address is correctly formatted and throw an error if it is not an valid address<br></br>*Inherited from [RainContract.checkAddress()](./raincontract.md#checkAddress-method-1)* |

## Static Property Details

<a id="deploy-property-static"></a>

### deploy

Deploys a new AutoApprove.

<b>Signature:</b>

```typescript
static deploy: (signer: Signer, autoApproveConfig: StateConfig, overrides?: TxOverrides) => Promise<AutoApprove>;
```

<a id="isChild-property-static"></a>

### isChild

Checks if address is registered as a child contract of this AutoApproveFactory on a specific network

<b>Signature:</b>

```typescript
static isChild: (signer: Signer, maybeChild: string) => Promise<boolean>;
```

<a id="nameBookReference-property-static"></a>

### nameBookReference

Name reference to find the address of the contract in the book address.

*Overrides [RainContract.nameBookReference](./raincontract.md#nameBookReference-property-static)*

Should be implemented in each class to find the factory or main address in the book.

<b>Signature:</b>

```typescript
protected static readonly nameBookReference: string;
```

<a id="Opcodes-property-static"></a>

### Opcodes

All the opcodes avaialbles in the AutoApprove contract.

This expose all the standard opcodes along with the specific local AutoApprove opcodes.

<b>Signature:</b>

```typescript
static Opcodes: AutoApproveOps;
```

## Property Details

<a id="afterAdd-property"></a>

### afterAdd


<b>Signature:</b>

```typescript
readonly afterAdd: (arg0: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```

<a id="afterApprove-property"></a>

### afterApprove


<b>Signature:</b>

```typescript
readonly afterApprove: (approver_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```

<a id="afterBan-property"></a>

### afterBan


<b>Signature:</b>

```typescript
readonly afterBan: (banner_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```

<a id="afterRemove-property"></a>

### afterRemove


<b>Signature:</b>

```typescript
readonly afterRemove: (remover_: string, evidences_: EvidenceConfig[], overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```

<a id="connect-property"></a>

### connect

Connect to this AutoApprove instance with a new signer

*Overrides [RainContract.connect](./raincontract.md#connect-property)*

<b>Signature:</b>

```typescript
readonly connect: (signer: Signer) => AutoApprove;
```

<a id="owner-property"></a>

### owner


<b>Signature:</b>

```typescript
readonly owner: (overrides?: ReadTxOverrides) => Promise<string>;
```

<a id="packedFunctionPointers-property"></a>

### packedFunctionPointers

Pointers to opcode functions, necessary for being able to read the packedBytes

<b>Signature:</b>

```typescript
readonly packedFunctionPointers: (overrides?: ReadTxOverrides) => Promise<string>;
```

<a id="renounceOwnership-property"></a>

### renounceOwnership


<b>Signature:</b>

```typescript
readonly renounceOwnership: (overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```

<a id="storageOpcodesRange-property"></a>

### storageOpcodesRange

Returns the pointer and length for AutoApprove's storage opcodes

<b>Signature:</b>

```typescript
readonly storageOpcodesRange: (overrides?: ReadTxOverrides) => Promise<StorageOpcodesRange>;
```

<a id="transferOwnership-property"></a>

### transferOwnership


<b>Signature:</b>

```typescript
readonly transferOwnership: (newOwner: string, overrides?: TxOverrides & {
from?: string | Promise<string>;
}) => Promise<ContractTransaction>;
```
Loading