Skip to content

Commit

Permalink
Merge pull request #211 from ERC725Alliance/develop
Browse files Browse the repository at this point in the history
chore(release): 5.0.0
  • Loading branch information
frozeman authored Apr 26, 2023
2 parents ea7f51f + c7f0092 commit 7171a0e
Show file tree
Hide file tree
Showing 28 changed files with 2,654 additions and 2,753 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Bug Report"
description: File a bug report
title: "[Bug]: "
labels:
- bug
body:
- attributes:
value: |
Please check the [issues tab](https://github.com/ERC725Alliance/ERC725/issues) to avoid duplicates.
Remember, this is not a place to ask for help debugging code. For that, we welcome you in the [LUKSO's discord server](https://discord.com/channels/359064931246538762/585786253992132609)!
Thanks for taking the time to fill out this bug report!
type: markdown
- attributes:
label: "Describe the issue:"
id: what-happen
type: textarea
validations:
required: true
- attributes:
label: "Expected behavior:"
id: expected-behavior
type: textarea
validations:
required: true
- attributes:
label: "Environment"
description: "Compiler version, Compiler options, Node/NPM version, Framework/IDE (e.g. Truffle/Hardhat/Remix), Operating System"
id: environment
type: textarea
validations:
required: true
- attributes:
label: "Code example to reproduce the issue:"
description: "It can be a GitHub repository/gist or a simple code snippet."
id: reproduce
type: textarea
validations:
required: true
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Questions & Support Requests
url: https://discord.com/channels/359064931246538762/585786253992132609
about: Ask in the dev-chat channel in LUKSO's discord server
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Feature | Changes Request
description: Suggest an idea to improve the repository.
title: "[Feature-Request]: "
labels:
- feature
body:
- attributes:
value: |
Please check the [issues tab](https://github.com/ERC725Alliance/ERC725/issues) to avoid duplicates.
Thanks for taking the time to provide feedback!
type: markdown
- attributes:
label: "Rationale/Motivation:"
description: "Explain why the feature is important and how it benefits the project."
id: rationale
type: textarea
validations:
required: true
- attributes:
label: "Describe the desired feature:"
description: Explain what the feature enables/improves.
id: feature-request
type: textarea
validations:
required: true
- attributes:
label: "Code example that enables the feature:"
description: "Can be a link to a GitHub repository, gist or a simple code snippet."
id: reproduce
type: textarea
68 changes: 68 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!-- Thank you for your interest in contributing to ERC725! -->

<!-- Consider opening an issue for discussion prior to submitting a PR. -->
<!-- Consider checking CONTRIBUTING.md before contributing. -->
<!-- New features will be merged faster if they were first discussed and designed with the team. -->

# What does this PR introduce?

<!-- Keep the sub-header that suits the PR and remove the rest -->

<!-- Changes that potentially causes other components to fail (changes in interfaceIds, function signatures, behavior, etc ..) --->
<!---
## ⚠️ BREAKING CHANGES
---->

<!---
## 🚀 Feature
---->

<!---
## 🐛 Bug
---->

<!---
## ♻️ Refactor
---->

<!---
## 🧪 Tests
---->

<!---
## ⚡️ Performance
---->

<!---
## 🎨 Style
---->

<!---
## 📄 Documentation
---->

<!---
## 📦 Build
---->

<!---
## 🤖 CI
---->

Fixes #???? <!-- Fill in with issue number -->

<!-- Describe the changes introduced in this pull request here. -->

<!-- Include any context necessary for understanding the PR's purpose. (Images, links, etc ..) -->

### PR Checklist

<!-- Before merging the pull request, making sure you have run locally the following. -->
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
<!-- (Some of the items may not apply.) -->

- [ ] Wrote Tests
- [ ] Wrote Documentation
- [ ] Ran `npm run lint`
- [ ] Ran `npm run build`
- [ ] Ran `npm run test`
69 changes: 14 additions & 55 deletions docs/ERC-725.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ And the event:

### ERC725X

**ERC725X** interface id according to [ERC165]: `0x570ef073`.
**ERC725X** interface id according to [ERC165]: `0x7545acac`.

Smart contracts implementing the ERC725X standard MUST implement the [ERC165] `supportsInterface(..)` function and MUST support the ERC165 and ERC725X interface ids.

Expand Down Expand Up @@ -103,13 +103,13 @@ data = <contract-creation-code> + <abi-encoded-constructor-arguments> + <bytes32

> See [EIP-1014: Skinny CREATE2](https://eips.ethereum.org/EIPS/eip-1014) for more information.
#### execute (Array)
#### executeBatch

```solidity
function execute(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes[] memory datas) external payable returns(bytes[] memory)
function executeBatch(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes[] memory datas) external payable returns(bytes[] memory)
```

Function Selector: `0x13ced88d`
Function Selector: `0x31858452`

Executes a batch of calls on any other smart contracts, transfers the blockchain native token, or deploys a new smart contract.
MUST only be called by the current owner of the contract.
Expand All @@ -134,26 +134,6 @@ _Returns:_ `bytes[]` , array list of returned data of the called function, or th

**Triggers Event:** [ContractCreated](#contractcreated), [Executed](#executed) on each call iteration

**Note:** The `execute()` functions use function overloading, therefore it is better to reference them by the given function signature as follows:

```js
// web3.js example

// execute
myContract.methods['execute(uint256,address,uint256,bytes)'](OPERATION_CALL, target.address, 2WEI, "0x").send();

// execute Array
myContract.methods['execute(uint256[],address[],uint256[],bytes[])']([OPERATION_CALL, OPERATION_CREATE], [target.address, ZERO_ADDRESS], [2WEI, 0WEI], ["0x", CONTRACT_BYTECODE]).send()

// OR

// execute
myContract.methods['0x44c028fe'](OPERATION_CALL, target.address, 2WEI, "0x").send();

// execute Array
myContract.methods['0x13ced88d']([OPERATION_CALL, OPERATION_CREATE], [target.address, ZERO_ADDRESS], [2WEI, 0WEI], ["0x", CONTRACT_BYTECODE]).send()
```

### Events

#### Executed
Expand All @@ -176,7 +156,7 @@ MUST be triggered when `execute` creates a new contract using the `operationType

### ERC725Y

**ERC725Y** interface id according to [ERC165]: `0x714df77c`.
**ERC725Y** interface id according to [ERC165]: `0x629aa694`.

Smart contracts implementing the ERC725Y standard MUST implement the [ERC165] `supportsInterface(..)` function and MUST support the ERC165 and ERC725Y interface ids.

Expand All @@ -200,13 +180,13 @@ _Parameters:_

_Returns:_ `bytes` , The data for the requested data key.

#### getData (Array)
#### getDataBatch

```solidity
function getData(bytes32[] memory dataKeys) external view returns(bytes[] memory)
```

Function Selector: `0x4e3e6e9c`
Function Selector: `0xdedff9c6`

Gets array of data at multiple given data keys.

Expand Down Expand Up @@ -237,13 +217,13 @@ _Requirements:_

**Triggers Event:** [DataChanged](#datachanged)

#### setData (Array)
#### setDataBatch

```solidity
function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) external payable
```

Function Selector: `0x14a6e293`
Function Selector: `0x97902421`

Sets array of data at multiple data keys. MUST only be called by the current owner of the contract.

Expand All @@ -259,26 +239,6 @@ _Requirements:_

**Triggers Event:** [DataChanged](#datachanged)

**Note:** `setData()` and `getData()` uses function overloading, therefore it is better to reference them by the given function signature as follows:

```js
// web3.js example

// setData
myContract.methods['setData(bytes32,bytes)'](dataKey, dataValue).send()

// setData Array
myContract.methods['setData(bytes32[],bytes[])']([dataKeys, ...], [dataValues, ...]).send()

// OR

// setData
myContract.methods['0x7f23690c'](dataKey, dataValue).send()

// setData Array
myContract.methods['0x14a6e293']([dataKeys, ...], [dataValues, ...]).send()
```

### Events

#### DataChanged
Expand All @@ -304,7 +264,7 @@ The data stored in an ERC725Y smart contract is not only readable/writable by of

## Backwards Compatibility

All contracts since ERC725v2 from 2018/19 should be compatible to the current version of the standard. Mainly interface ID and Event parameters have changed, while `getData(bytes32[])` and `setData(bytes32[], bytes[])` was added as an efficient way to set/get multiple keys at once. The same applies for execution, as `execute(..[])` was added as an efficient way to batch calls.
All contracts since ERC725v2 from 2018/19 should be compatible to the current version of the standard. Mainly interface ID and Event parameters have changed, while `getDataBatch(bytes32[])` and `setDataBatch(bytes32[], bytes[])` was added as an efficient way to set/get multiple keys at once. The same applies for execution, as `executeBatch(..[])` was added as an efficient way to batch calls.

## Reference Implementation

Expand All @@ -322,25 +282,24 @@ When using the operation type `4` for `delegatecall`, it is important to conside
// SPDX-License-Identifier: CC0-1.0
pragma solidity >=0.5.0 <0.7.0;
// ERC165 identifier: `0x570ef073`
interface IERC725X /* is ERC165, ERC173 */ {
event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 indexed value, bytes32 salt);
event Executed(uint256 indexed operationType, address indexed target, uint256 indexed value, bytes4 data);
function execute(uint256 operationType, address target, uint256 value, bytes memory data) external payable returns(bytes memory);
function execute(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes memory datas) external payable returns(bytes[] memory);
function executeBatch(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes memory datas) external payable returns(bytes[] memory);
}
// ERC165 identifier: `0x714df77c`
interface IERC725Y /* is ERC165, ERC173 */ {
event DataChanged(bytes32 indexed dataKey, bytes dataValue);
function getData(bytes32 dataKey) external view returns(bytes memory);
function getData(bytes32[] memory dataKeys) external view returns(bytes[] memory);
function getDataBatch(bytes32[] memory dataKeys) external view returns(bytes[] memory);
function setData(bytes32 dataKey, bytes memory dataValue) external;
function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) external;
function setDataBatch(bytes32[] memory dataKeys, bytes[] memory dataValues) external;
}
interface IERC725 /* is IERC725X, IERC725Y */ {
Expand Down
10 changes: 10 additions & 0 deletions implementations/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
5 changes: 2 additions & 3 deletions implementations/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"overrides": [
{
"files": ["*.js", "*.,ts"],
"files": ["*.js", "*.ts"],
"options": {
"tabWidth": 4,
"useTabs": true,
"tabWidth": 2,
"printWidth": 100,
"trailingComma": "all",
"singleQuote": true
Expand Down
17 changes: 17 additions & 0 deletions implementations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [5.0.0](https://github.com/ERC725Alliance/ERC725/compare/v4.2.0...v5.0.0) (2023-04-26)

### ⚠ BREAKING CHANGES

- Remove function overloading and rename overloaded functions to add "Batch" keyword: ([#209](https://github.com/ERC725Alliance/ERC725/pull/209))
- `setData(bytes32[],bytes[])` --> `setDataBatch(bytes32[],bytes[])`
- `getData(bytes32[])` --> `getDataBatch(bytes32[])`
- `execute(uint256[],address[],uint256[],bytes[])` --> `executeBatch(uint256[],address[],uint256[],bytes[])`

- Change interfaceId of ERC725X and ERC725Y: ([#209](https://github.com/ERC725Alliance/ERC725/pull/209))
- ERC725X from `0x570ef073` to `0x7545acac`
- ERC725Y from `0x714df77c` to `0x629aa694`

### Refactor

- Remove parameters from error in ERC725Y (`ERC725Y_DataKeysValuesLengthMismatch`) ([#208](https://github.com/ERC725Alliance/ERC725/pull/208))

## [4.2.0](https://github.com/ERC725Alliance/ERC725/compare/v4.1.1...v4.2.0) (2023-03-13)

### ⚠ BREAKING CHANGES
Expand Down
Loading

0 comments on commit 7171a0e

Please sign in to comment.