From 277e4519c1126f0a87355b2ffccc849613adb4d8 Mon Sep 17 00:00:00 2001 From: Oleksiy Pyltsov Date: Sat, 13 Jul 2024 14:01:15 +0200 Subject: [PATCH] Change temporary contract functions And run "forge fmt". --- contracts/src/Wingman.sol | 45 +++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/contracts/src/Wingman.sol b/contracts/src/Wingman.sol index 8d8bf07..cde6199 100644 --- a/contracts/src/Wingman.sol +++ b/contracts/src/Wingman.sol @@ -10,15 +10,15 @@ contract Wingman is ERC7579ValidatorBase { struct Backup { uint48 createdAt; - uint48 initiatedAt; - uint48 expiresAt; - Beneficiary[] beneficiaries; + uint48 initiatedAt; + uint48 expiresAt; + Beneficiary[] beneficiaries; } struct Beneficiary { - address account; - uint8 percentage; - uint256 amount; + address account; + uint8 percentage; + uint256 amount; } /** @@ -92,32 +92,25 @@ contract Wingman is ERC7579ValidatorBase { return EIP1271_FAILED; } - function createBackup( - string memory name, - uint48 expiresAt - ) public { - Backup storage backup = backups[msg.sender][name]; - backupNames[msg.sender].push(name); - backup.createdAt = uint48(block.timestamp); - backup.initiatedAt = uint48(block.timestamp); - backup.expiresAt = expiresAt; + function createBackup(string memory name, uint48 expiresAt) public { + Backup storage backup = backups[msg.sender][name]; + backupNames[msg.sender].push(name); + backup.createdAt = uint48(block.timestamp); + backup.initiatedAt = uint48(block.timestamp); + backup.expiresAt = expiresAt; } - function addBeneficiary( - string calldata name, - address account, - uint8 percentage - ) public { - Backup storage backup = backups[msg.sender][name]; - backup.beneficiaries.push(Beneficiary(account, percentage, 0)); + function addBeneficiary(string calldata name, address account, uint8 percentage) public { + Backup storage backup = backups[msg.sender][name]; + backup.beneficiaries.push(Beneficiary(account, percentage, 0)); } - function getBackups() public view returns (string[] memory) { - return backupNames[msg.sender]; + function getBackups(address account) public view returns (string[] memory) { + return backupNames[account]; } - function getBackup(string calldata name) public view returns (Backup memory) { - return backups[msg.sender][name]; + function getBackup(address account, string calldata name) public view returns (Backup memory) { + return backups[account][name]; } /**