Skip to content

Releases: lukso-network/lsp-smart-contracts

v0.6.1

10 Jun 16:36
ac4133b
Compare
Choose a tag to compare

What does this PR introduce?

  • bump package.json version from 0.6.0 -> 0.6.1
  • added release to CHANGELOG.md

BREAKING CHANGES

  • the LSP2 array data keys defined in constants.js are now splitted in two: .length and .index (#192)
  • 🧬 the interfaceId of the LSP1Delegate contract was changed from 0xc2d7bcc1 > 0xa245bbda, because of the change in its function definition. See below for more details.

  • 🔈 🗒️ the function universalReceiverDelegate(...) in the LSP1UniversalReceiverDelegate contract now accept an extra parameter uint256 value, to inform the delegate contract if some value was to the contract implementing the LSP1 standard.

The function definition was changed from this (before)

function universalReceiverDelegate(
        address sender,
        bytes32 typeId,
        bytes memory data
    ) external returns (bytes memory result);

to this (after)

function universalReceiverDelegate(
        address caller,
        uint256 value,
        bytes32 typeId,
        bytes memory data
    ) external returns (bytes memory result);

See the function definition here for more info: https://github.com/lukso-network/lsp-smart-contracts/blob/ac4133b40c10e0b73227caa6f3a2b88b32bf4403/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol#L10-L23

Features

  • update receive() function to fallback() payable, to allow sending random bytes payload to the fallback function. (#194)

  • 🔈 the universalReceiver(...) function is now payable and can receive native tokens while being called. (#193) (5b2bc60)

  • add error signatures in constants.js(#191)

  • add LSP1 Type IDs in constants.js (#196)

v0.6.0

06 Jun 16:33
bcce264
Compare
Choose a tag to compare

What does this release introduce?

see the release changelog for more details

BREAKING CHANGES

🧬 Many interface IDs have been changed

  • LSP0: 0x63cb749b > 0x9a3bfe88
  • LSP6: 0x6f4df48b > 0xc403d48f
  • LSP9: 0x75edcee5 > 0x8c1d44f6

LSP0 + LSP9 now includes the functions from ClaimOwnership when calculating their interface ID.

🔑 LSP6 - Key Manager

  • the contract includes the standard target() function in its interface, that enables to retrieve the address of the ERC725 Account linked to this Key Manager.
  • delegatecall is also disabled in the KeyManager by default for security, as this type of operation is dangerous and could be harmful for the linked account.
  • The Executed event in the KeyManager now include only the bytes4 selector of the function run on the linked ERC725 account. 📉 This reduce gas and transaction cost when interacting with Universal Profile via Key Manager.
  • the parameters of the function executeRelayCall(...) have been changed and re-ordered. Function selector changed from 0x32e6d0ab ❌ to 0xc403d48f ✅ (see lukso-network/LIPs#77 and #159 for details about the changes)

Before

function executeRelayCall(
    address _signedFor,
    uint256 _nonce,
    bytes calldata _data,
    bytes memory _signature
) external payable returns (bytes memory);

Now

function executeRelayCall(
    bytes memory _signature,
    uint256 _nonce,
    bytes calldata _calldata
) external payable returns (bytes memory);
  • The signature in executeRelayCall(...) includes an additional parameter chainId. It MUST be constructed as follow:
<block.chainid> + <KeyManager address> + <signer nonce> + <_calldata payload>

LSP2

  • the SupportedStandards:{LSPN} metadata keys were changed with a new bytes ordering. See lukso-network/LIPs#84 for details about the change.

  • the name + semantics of multiple key types were changed:

    • Mapping: includes standard Mapping + old Bytes20Mapping
    • Bytes20MappingWithGrouping ❌ > renamed to MappingWithGrouping.

For more details about the LSP2 breaking changes, see:

Features

  • LSP0 and LSP9 contracts now use ClaimOwnership as a new mechanism to transfer ownership of the contract to a new owner.

🔑 LSP6 - Key Manager

  • LSP6KeyManager now introduce two additional paths to interact with the linked ERC725Account:
    • claimOwnership(): for transferring ownership from an EOA to a KeyManager, or upgrading to a KeyManager.
    • setData(bytes32,bytes): enable to set a single ERC725Y data key, without the need to wrap it into an array.
  • introduce the following SUPER permissions in LSP6KeyManager:
    • SUPERS_SETDATA: allow to skip checks for AllowedERC725YKeys and save gas when setting data on the linked account.
    • SUPER_TRANSFERVALUE, SUPER_CALL, SUPER_STATICCALL and SUPER_DELEGATECALL: allow to skip checks for AllowedAddresses, Functions and Standards and save gas on contract interactions.
  • The functions execute(...) and executeRelayCall(...) now handle and bubble up custom Solidity error fired on target contracts.

🪙 🎨 Tokens & NFTs Standards (LSP7 + LSP8)

  • Both LSP7 and LSP8 + the LSP7/8 Capped Supply preset contracts now use Solidity custom error

Others

  • 🏭 introduce a UniversalFactory contract, that enable to deploy Universal Profile and other LSP smart contracts across multiple chains at the same address.

Bug Fixes

🔔 LSP1 - Universal Receiver

  • an extra check has been added to ensure the sender is a smart contract and not an EOA, so to prevent spamming on the Universal Receiver Delegate.

🔑 LSP6 - Key Manager

  • add chainId parameter in executeRelayCall(...), to prevent replay attacks across multiple chains.
  • value can now be forwarded via the executeRelayCall(...) function.

🪙 🎨 Tokens & NFTs Standards (LSP7 + LSP8)

  • The data keys LSP4TokenName and LSP4TokenSymbol is now not editable in both LSP7 and LSP8.
  • apply check-effect-interaction pattern in LSP7 and LSP8 contracts

🏗️ Build

@erc725/smart-contracts

The main changes relates to the @erc725/smart-contracts main dependency. The dependency was bumped from 2.3.0 to 3.1.0. This introduced several breaking changes:

  • ERC725X:

    • Executed event in ERC725X.execute(...) now include only the first 4 bytes of the function selector being run on the contract being called. 📉
    • 🚫 the operation type DELEGATE_CALL does not check anymore if the owner() has been changed after doing a delegatecall. This resulting in disallowing this operation type completely on the KeyManager.
    • value cannot be passed as a parameter (MUST be 0) for operation types STATICCALL and DELEGATECALL
    • the to address MUST be address(0) for operation type CREATE and CREATE2
  • ERC725Y:

    • DataChanged event only emit the data key edited, not the value that was changed. 📉
    • introduce overloaded functions getData(bytes32) and setData(bytes32,bytes) to enable to read/write only one data key from the key-value store. 🗄️

For more details about these changes, see https://github.com/ERC725Alliance/ERC725/blob/develop/implementations/CHANGELOG.md

constants.js file

  • The constant file was changed from Typescript to Javascript.
  • The permission DELEGATECALL was removed from the ALL_DEFAULT_PERMISSIONS constant value.

v0.5.0

24 Feb 09:39
8e35267
Compare
Choose a tag to compare

Features

  • 🔑 ➕ Add a new type of permissions AllowedERC725YKeys in the KeyManager. Enables to restrict an address that has permission SETDATA to set only a specific set of bytes32 keys.

This includes partial keys, which can be useful for keys that derive from the Mapping or Array key types defined in LSP2 - ERC725Y JSON Schema

  • 🧬 added interface ids of ERC tokens standards in the file constants.ts. This includes ERC20, ERC721, ERC223, ERC777 and ERC1155.

  • added proxy versions of LSP7CompatibilityForERC20 and LSP8CompatibilityForERC721

Deprecated

  • ➖ remove + drop support for dataKeys[] and allDataKeys() function in Universal Profile contracts.

Bug fixes

  • ILSP8CompatabilityForERC721 isApprovedForAll(...) params match IERC721
  • ⚠️ fix medium security vulnerability in LSP1UniversalReceiverUP contract

A new security check has been added to this contract to that the profile(msg.sender) making the call to the Universal Receiver is the same profile than the one extracted from the Key Manager read from the owner() function

Commits references

Features

  • add check for multiple ERC725Y keys (5ee41c7)
  • add check for partial keys + test for Mapping keys (57923ca)
  • add custom error log for AllowedERC725YKey (dcefa95)
  • allow whitelisting any ERC725Y key if nothing set (41dd20f)
  • create LSP7CompatabilityForERC20InitAbstract (516d195)
  • create LSP8CompatabilityForERC721InitAbstract (1ded846)
  • first draft implementation of AllowedERC725YKeys, with only one key check (ac567c3)
  • LSP7CompatibilityForERC20 proxy and constructor version (131eed0)
  • LSP8CompatibilityForERC721 proxy and constructor version (ffccc4b)

Bug Fixes

  • ILSP8CompatabilityForERC721 isApprovedForAll params match IERC721 (fed55a9)
  • LSP8 InitAbstract contract inheritance order (e9e61c1)
  • security check in UniversalReceiverDelegateUP contract (#109) (faac8df)

v0.4.3

26 Jan 10:47
6c11e54
Compare
Choose a tag to compare

What Changes this PR introduce ?

  • Fix OZ initializer breaking change
  • Add InitAbstract contracts used for inheritance in case of proxies
  • Move ERC725Account to the repo'
  • Move related libraries

v0.3.0

16 Nov 13:38
90daf63
Compare
Choose a tag to compare

This release mainly changes the way smart contracts are exposed in the npm package:
(build/ is now not in the path anymore)

in Javascript

You can use the contracts JSON ABI by importing them as follow:

import UniversalProfile from "@lukso/universalprofile-smart-contracts/artifacts/UniversalProfile.json";

const myContract = new this.web3.eth.Contract(UniversalProfile.abi, "", defaultOptions);

in Solidity

import UniversalProfile from "@lukso/universalprofile-smart-contracts/contracts/UniversalProfile.sol";

BREAKING CHANGE in the KeyManager: For the KeyManager, we changed the permission bit order!
The new order can be found here: https://docs.lukso.tech/standards/LSP6-KeyManager#-permission-values
All permission from SETDATA on are pushed one bit higher, as we added the ADDPERMISSIONS permission. To distinguish between CHANGEPERMISSION and adding permissions (the latter is far more sensitive).

⚠ BREAKING CHANGES

  • ILSP6 interface return type change.

  • test!(KM): return bytes or revert on execute / executeRelayCall

Tests by interacting with TargetContract

  • test!(KM): Remove gasLimit specified in tests.

  • feat!(KM): Extend permission range to 256 (32 bytes)

  • test!(KM): Use 32 bytes padding for 32 bytes permissions range

  • test!: ➕ set AddressPermissions[] in tests

Addresses with permissions set MUST be added to an array inside ERC725Y key-value (see LSP6 specs)

  • Fixed KeyManager permission key name

  • the contracts + artifacts names have changed for all three packages

  • feat!: ✨ make ERC20 / 721 compatible versions of LSP7/8 deployable

  • fix: 💚 fix solhint CI error for empty block

  • build: ➖ remove submodule folder

ERC725 contracts are now imported as a npm package @erc725/smart-contracts/

Co-authored-by: YamenMerhi [email protected]

  • npm: ➕ add npm dependency: @erc725/smart-contracts

Bug Fixes

  • added contracts as dependencies (3f12e97)
  • gradle file invalid syntax (#47) (633fa07)

build

v0.2.2

01 Nov 11:58
Compare
Choose a tag to compare

This release is the first release of the final UniversalProfile setup. It should be seen as a draft and not production ready release! Please use with caution!

⚠ BREAKING CHANGES

  • ILSP6 interface return type change.

  • test!(KM): return bytes or revert on execute / executeRelayCall

Tests by interacting with TargetContract

  • test!(KM): Remove gasLimit specified in tests.

  • feat!(KM): Extend permission range to 256 (32 bytes)

  • test!(KM): Use 32 bytes padding for 32 bytes permissions range

  • test!: ➕ set AddressPermissions[] in tests

Addresses with permissions set MUST be added to an array inside ERC725Y key-value (see LSP6 specs)

  • KeyManager returns bytes + permission range extended to bytes32 (#32) (7b6dcf0), closes #32

Bug Fixes

JSON Artifacts

31 Aug 22:13
Compare
Choose a tag to compare
JSON Artifacts Pre-release
Pre-release

Include contracts ABIs as JSON.

Typechain and Hardhat

31 Aug 21:45
Compare
Choose a tag to compare
Typechain and Hardhat Pre-release
Pre-release

Migrated from truffle to hardhat 🚀