Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update LSP0 Natspec #631

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 8 additions & 36 deletions contracts/LSP0ERC725Account/ILSP0ERC725Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,25 @@ import {
import {ILSP14Ownable2Step} from "../LSP14Ownable2Step/ILSP14Ownable2Step.sol";

/**
* @title Interface of the LSP0 - ERC725Account standard, an account based smart contract that represents an identity on-chain.
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md
* @title Interface of the [LSP-0-ERC725Account] standard, an account based smart contract that represents an identity on-chain.
*
* @author Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)
* @dev A smart contract account including basic functionalities such as:
*
* - Detecting supported standards using ERC165
* https://eips.ethereum.org/EIPS/eip-165
*
* - Executing several operation on other addresses including creating contracts using ERC725X
* https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md
*
* - Storing data in a generic way using ERC725Y
* https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md
*
* - Validating signatures using ERC1271
* https://eips.ethereum.org/EIPS/eip-1271
*
* - Receiving notification and react on them using LSP1
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md
*
* - Secure ownership management using LSP14
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md
*
* - Extending the account with new functions and interfaceIds of future standards using LSP17
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md
*
* - Verifying calls on the owner to allow unified and standard interaction with the account using LSP20
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md
*
* This interface implicitly inherits: IERC165, IERC725X, IERC725Y, IERC1271, ILSP1UniversalReceiver, ILSP14Ownable2Step
*/
interface ILSP0ERC725Account {
/**
* @notice Emitted when receiving native tokens
* @param sender The address of the sender
* @param value The amount of native tokens received
* @dev Emitted when receiving native tokens.
* @notice `value` native tokens received from `sender`.
* @param sender The address that sent some native tokens to this contract.
* @param value The amount of native tokens received.
*/
event ValueReceived(address indexed sender, uint256 indexed value);

/**
* @dev Allows a caller to batch different function calls in one call.
* Perform a delegatecall on self, to call different functions with preserving the context
* It is not possible to send value along the functions call due to the use of delegatecall.
* @notice Executing the following batch of abi-encoded function calls on the contract: `data`.
*
* @dev Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context.
CJ42 marked this conversation as resolved.
Show resolved Hide resolved
* @param data An array of ABI encoded function calls to be called on the contract.
* @return results An array of values returned by the executed functions.
* @return results An array of abi-encoded data returned by the functions executed.
*/
function batchCalls(
bytes[] calldata data
Expand Down
45 changes: 15 additions & 30 deletions contracts/LSP0ERC725Account/LSP0ERC725Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,29 @@ import {
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";

/**
* @title Deployable Implementation of LSP0-ERC725Account Standard
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md
* @title Deployable Implementation of [LSP-0-ERC725Account] Standard.
*
* @author Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)
* @dev A smart contract account including basic functionalities such as:
*
* - Detecting supported standards using ERC165
* https://eips.ethereum.org/EIPS/eip-165
*
* - Executing several operation on other addresses including creating contracts using ERC725X
* https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md
*
* - Storing data in a generic way using ERC725Y
* https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md
*
* - Validating signatures using ERC1271
* https://eips.ethereum.org/EIPS/eip-1271
*
* - Receiving notification and react on them using LSP1
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md
*
* - Secure ownership management using LSP14
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md
*
* - Extending the account with new functions and interfaceIds of future standards using LSP17
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md
*
* - Verifying calls on the owner to allow unified and standard interaction with the account using LSP20
* https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md
* @dev A smart contract account including basic functionalities such as:
* - Detecting supported standards using [ERC-165]
b00ste marked this conversation as resolved.
Show resolved Hide resolved
* - Executing several operation on other addresses including creating contracts using [ERC-725X]
* - A generic data key-value store using [ERC-725Y]
* - Validating signatures using [ERC-1271]
* - Receiving notification and react on them using [LSP-1-UniversalReceiver]
* - Safer ownership management through 2-steps transfer using [LSP-14-Ownable2Step]
* - Extending the account with new functions and interfaceIds of future standards using [LSP-17-ContractExtension]
* - Verifying calls on the owner to make it easier to interact with the account directly using [LSP-20-CallVerification]
*/
contract LSP0ERC725Account is LSP0ERC725AccountCore {
/**
* @notice Deploying the contract with owner set to: `initialOwner`
* @dev Set `initialOwner` as the contract owner.
* The `constructor` also allows funding the contract on deployment.
* @notice Deploying a LSP0ERC725Account contract with owner set to address `initialOwner`.
* @dev Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment.
* @param initialOwner The owner of the contract.
*
* @custom:events {ValueReceived} event when funding the contract on deployment.
* @custom:events
* - {ValueReceived} event when funding the contract on deployment.
* - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
*/
constructor(address initialOwner) payable {
if (msg.value != 0) {
Expand Down
Loading
Loading