Skip to content

Commit

Permalink
Merge pull request #194 from ERC725Alliance/develop
Browse files Browse the repository at this point in the history
chore: release 4.1.1
  • Loading branch information
frozeman authored Jan 18, 2023
2 parents e2c1594 + f050880 commit 8393704
Show file tree
Hide file tree
Showing 10 changed files with 4,091 additions and 7,821 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow ensure that the smart contracts can be compiled
# with different Solidity 0.8.x versions
name: Solidity Compiler Versions

on:
pull_request:
branches:
- "main"
- "develop"

jobs:
solc_version:
runs-on: ubuntu-latest
defaults:
run:
working-directory: implementations
strategy:
matrix:
solc: [
"0.8.8",
"0.8.9",
# "0.8.10" skipped as default in hardhat.config.ts
"0.8.11",
"0.8.12",
"0.8.13",
"0.8.14",
"0.8.15",
"0.8.16",
"0.8.17",
]
steps:
- uses: actions/checkout@v3

- name: Setup Node.js 16
uses: actions/setup-node@v2
with:
node-version: "16"
cache: "npm"
cache-dependency-path: implementations/package-lock.json

- name: 📦 Install dependencies
run: npm ci

- name: Install solc-select
run: pip3 install solc-select

- name: Use Solc v${{ matrix.solc }}
run: |
solc-select install ${{ matrix.solc }}
solc-select use ${{ matrix.solc }}
- name: Compile Smart Contracts
run: |
solc contracts/**/*.sol \
@openzeppelin/=node_modules/@openzeppelin/ \
solidity-bytes-utils/=node_modules/solidity-bytes-utils/
4 changes: 2 additions & 2 deletions docs/ERC-725.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ eip: 725
title: General data key/value store and execution
description: An interface for a smart contract based account with attachable data key/value store
author: Fabian Vogelsteller (@frozeman), Tyler Yasaka (@tyleryasaka)
discussions-to: https://github.com/ethereum/EIPs/issues/725
discussions-to: https://ethereum-magicians.org/t/discussion-for-eip725/12158
status: Review
type: Standards Track
category: ERC
Expand Down Expand Up @@ -314,7 +314,7 @@ All contracts since ERC725v2 from 2018/19 should be compatible to the current ve

Reference implementations can be found [here](../assets/eip-725)

## Security Consideration
## Security Considerations

This contract allows generic executions, therefore special care need to be take care to prevent re-entrancy attacks and other forms of call chain attacks.

Expand Down
12 changes: 12 additions & 0 deletions implementations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@

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.

### [4.1.1](https://github.com/ERC725Alliance/ERC725/compare/v4.1.0...v4.1.1) (2023-01-17)


### Bug Fixes

* re-add `override` keyword for functions inherited from interface to compiling with solc compiler 0.8.7 or 0.8.6 ([#188](https://github.com/ERC725Alliance/ERC725/pull/188))

### Build

* add Errors & Events definitions to `constants.js` ([#192](https://github.com/ERC725Alliance/ERC725/pull/192))

## [4.1.0](https://github.com/ERC725Alliance/ERC725/compare/v4.0.0...v4.1.0) (2022-12-09)


### ⚠ BREAKING CHANGES

* add `salt` parameter to the `ContractCreated` event in ERC725X (#183)

### Features

* create internal virtual `_execute` function with core ERC725X logic to improve overriding core behaviour ([#184](https://github.com/ERC725Alliance/ERC725/pull/184))
* add `salt` parameter to the `ContractCreated` event in ERC725X ([#183](https://github.com/ERC725Alliance/ERC725/issues/183)) ([4a6ca14](https://github.com/ERC725Alliance/ERC725/commit/4a6ca140b35f1d78f6fefedb11ddc3981f71acb6))
Expand Down
61 changes: 61 additions & 0 deletions implementations/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# **Release Process**

Releases are published when a commit including an increase in the `package.json` version number is merged to the `main` branch.

This command will increases the version automatically using [standard-version](https://github.com/conventional-changelog/standard-version):

```bash
$ npm run release
```

If the current branch contains new commits since the last git tag that contains [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) prefixes like `feat`, `fix` or `docs`, it will increase the version as follows:

- `feat` will increase the `minor` version
- `fix` and `docs` will increase the `patch` version

Standard-version then:

1. updates the `package.json` version
2. adds to the `CHANGELOG.md` all commit messages grouped by `Feature`, `Bug Fixes`, `Documentation` or `Other`
3. commits all changes under: `chore(release): <version>`

Then push the changes to `develop`:

```bash
$ git push origin develop
```

A NPM and GitHub release is created when a version change in `package.json` is merged into `main`.

A git tag will then be created, a GitHub Release created with the description of the PR to `main` as the release notes with the appended `CHANGELOG.md` content, and iOS and Android Artifacts attached.
At last a release will be published in NPM automatically.

&nbsp;

## Specific Version Increases

To ignore the automatic version increase in favour of a custom version use the `--release-as` flag with the argument `major`, `minor` or `patch` or a specific version number:

```bash
npm run release -- --release-as minor
# Or
npm run release -- --release-as 1.1.0
```

## Prerelease versions

To create a pre-release run:

```bash
npm run release -- --prerelease
```

If the lastest version is 1.0.0, the pre-release command will change the version to: `1.0.1-0`

To name the pre-release, set the name by adding `--prerelease <name>`

```bash
npm run release -- --prerelease alpha
```

If the latest version is 1.0.0 this will change the version to: `1.0.1-alpha.0`
84 changes: 84 additions & 0 deletions implementations/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,92 @@ const FUNCTIONS_SELECTOR = {
SETDATA_ARRAY: '0x14a6e293',
};

const Errors = {
ERC725X: {
'0x0df9a8f8': {
error: 'ERC725X_InsufficientBalance(uint256,uint256)',
message: 'ERC725X: Sending more balance than available in the contract',
},
'0x7583b3bc': {
error: 'ERC725X_UnknownOperationType(uint256)',
message: 'ERC725X: Operation type provided is none of the default operation types available',
},
'0x72f2bc6a': {
error: 'ERC725X_MsgValueDisallowedInStaticCall()',
message: 'ERC725X: Sending value is not allowed when making a staticcall',
},
'0x5ac83135': {
error: 'ERC725X_MsgValueDisallowedInDelegateCall()',
message: 'ERC725X: Sending value is not allowed when making a delegatecall',
},
'0x3041824a': {
error: 'ERC725X_CreateOperationsRequireEmptyRecipientAddress()()',
message: 'ERC725X: The `to` address needs to be address(0) when deploying contracts',
},
'0x0b07489b': {
error: 'ERC725X_ContractDeploymentFailed()',
message: 'ERC725X: Contract deployment failed',
},
'0xb81cd8d9': {
error: 'ERC725X_NoContractBytecodeProvided()',
message: 'ERC725X: Contract deployment requires bytecode to be provided as data',
},
'0x3ff55f4d': {
error: 'ERC725X_ExecuteParametersLengthMismatch()',
message: 'ERC725X: Parameters length mismatch in execute batch',
},
},
ERC725Y: {
'0x43a3c266': {
error: 'ERC725Y_DataKeysValuesLengthMismatch(uint256,uint256)',
message: 'ERC725Y: Parameters length mismatch in setData batch',
},
},
}

const EventSignatures = {
ERC725X: {
/**
* event ContractCreated(
* uint256 indexed _operation,
* address indexed _contractAddress,
* uint256 indexed _value
* bytes32 _salt
* );
*
* signature = keccak256('ContractCreated(uint256,address,uint256,bytes32)')
*/
ContractCreated: '0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3',
/**
* event Executed(
* uint256 indexed _operation,
* address indexed _to,
* uint256 indexed _value,
* bytes4 _data
* );
*
* signature = keccak256('Executed(uint256,address,uint256,bytes4)')
*/
Executed: '0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e',
},
ERC725Y: {
/**
* event DataChanged(
* bytes32 indexed dataKey,
* bytes dataValue
* );
*
* signature = keccak256('DataChanged(bytes32,bytes)')
*/
DataChanged: '0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2',
},
}


module.exports = {
INTERFACE_ID,
OPERATION_TYPE,
Errors,
EventSignatures,
FUNCTIONS_SELECTOR,
};
4 changes: 2 additions & 2 deletions implementations/contracts/ERC725XCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X {
address target,
uint256 value,
bytes memory data
) public payable virtual onlyOwner returns (bytes memory) {
) public payable virtual override onlyOwner returns (bytes memory) {
return _execute(operationType, target, value, data);
}

Expand All @@ -54,7 +54,7 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X {
address[] memory targets,
uint256[] memory values,
bytes[] memory datas
) public payable virtual onlyOwner returns (bytes[] memory) {
) public payable virtual override onlyOwner returns (bytes[] memory) {
return _execute(operationsType, targets, values, datas);
}

Expand Down
6 changes: 4 additions & 2 deletions implementations/contracts/ERC725YCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y {
/**
* @inheritdoc IERC725Y
*/
function getData(bytes32 dataKey) public view virtual returns (bytes memory dataValue) {
function getData(bytes32 dataKey) public view virtual override returns (bytes memory dataValue) {
dataValue = _getData(dataKey);
}

Expand All @@ -41,6 +41,7 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y {
public
view
virtual
override
returns (bytes[] memory dataValues)
{
dataValues = new bytes[](dataKeys.length);
Expand All @@ -55,7 +56,7 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y {
/**
* @inheritdoc IERC725Y
*/
function setData(bytes32 dataKey, bytes memory dataValue) public virtual onlyOwner {
function setData(bytes32 dataKey, bytes memory dataValue) public virtual override onlyOwner {
_setData(dataKey, dataValue);
}

Expand All @@ -65,6 +66,7 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y {
function setData(bytes32[] memory dataKeys, bytes[] memory dataValues)
public
virtual
override
onlyOwner
{
if (dataKeys.length != dataValues.length) {
Expand Down
8 changes: 4 additions & 4 deletions implementations/contracts/helpers/CustomRevertTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ contract RevertTester {
revert MyCustomError(msg.sender, tx.origin);
}

function revertMeWithStringView() public view {
function revertMeWithStringView() public pure {
revert("I reverted");
}

function revertMeWithStringErrorNotView() public {
function revertMeWithStringErrorNotView() public pure {
revert("I reverted");
}

function revertMeWithCustomErrorView() public {
function revertMeWithCustomErrorView() public view {
// solhint-disable-next-line avoid-tx-origin
revert MyCustomError(msg.sender, tx.origin);
}

function revertMeWithCustomErrorNotView() public {
function revertMeWithCustomErrorNotView() public view {
// solhint-disable-next-line avoid-tx-origin
revert MyCustomError(msg.sender, tx.origin);
}
Expand Down
Loading

0 comments on commit 8393704

Please sign in to comment.