Skip to content

Commit

Permalink
FIX: rebranding keyper to palmera
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredolopez80 committed May 16, 2024
1 parent 0b9218f commit 05ee7c3
Show file tree
Hide file tree
Showing 39 changed files with 1,639 additions and 1,621 deletions.
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GOERLI_RPC_URL=
SEPOLIA_RPC_URL=
PRIVATE_KEY=
DEPLOYER_ADDRESS=
### Keyper Contracts deployed
### Palmera Contracts deployed

# Sepolia deployed versions
# MASTER_COPY_ADDRESS=0x69f4D1788e39c87893C980c06EdF4b7f686e2938
Expand All @@ -16,9 +16,9 @@ DEPLOYER_ADDRESS=
# Polygon deployed versions
MASTER_COPY_ADDRESS=0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552
PROXY_FACTORY_ADDRESS=0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2
# KEYPER_MODULE_ADDRESS=0x82b76A91D5F02235892bD473D7E36542BCf5eE97
# KEYPER_ROLES_ADDRESS=0x2Ec3ceBB0C054f15FaBa92e55E03FF689e09db9b
# KEYPER_GUARD_ADDRESS=0x52a7D134E8aC205dbEd7786c6EC45b20d92d8323
# PALMERA_MODULE_ADDRESS=0x82b76A91D5F02235892bD473D7E36542BCf5eE97
# PALMERA_ROLES_ADDRESS=0x2Ec3ceBB0C054f15FaBa92e55E03FF689e09db9b
# PALMERA_GUARD_ADDRESS=0x52a7D134E8aC205dbEd7786c6EC45b20d92d8323
# RECEIVER_ADDRESS=0x54c29072A5EBFc4BCA9325864860be9Fa0d170a6


Expand Down
312 changes: 156 additions & 156 deletions .gas-snapshot

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
env:
MASTER_COPY_ADDRESS: "0xd4a1E956fFe2D07CD71c8fABf538f2BfC0e3899B"
PROXY_FACTORY_ADDRESS: "0xEAb613456d3efD309101BB02872BEdCecE2879E2"
KEYPER_MODULE_ADDRESS: "0xc74f6cAFb3e89006FE9c0E8Be8Dc06888e178F1b"
PALMERA_MODULE_ADDRESS: "0xc74f6cAFb3e89006FE9c0E8Be8Dc06888e178F1b"
OWNER_1: "0x9CDd325E49A6a8a82288fdC3B6C14b25221D1Cfa"
OWNER_2: "0xEd4AD3605740D6a9232e05F4d8A2b3377f81a8AA"
THRESHOLD: 1
Expand All @@ -27,7 +27,7 @@ jobs:
touch .env
echo "MASTER_COPY_ADDRESS=$MASTER_COPY_ADDRESS" >> .env
echo "PROXY_FACTORY_ADDRESS=$PROXY_FACTORY_ADDRESS" >> .env
echo "KEYPER_MODULE_ADDRESS=$KEYPER_MODULE_ADDRESS" >> .env
echo "PALMERA_MODULE_ADDRESS=$PALMERA_MODULE_ADDRESS" >> .env
echo "OWNER_1=$OWNER_1" >> .env
echo "OWNER_2=$OWNER_2" >> .env
echo "THRESHOLD=$THRESHOLD" >> .env
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ rename :; chmod +x ./scripts/* && ./scripts/rename.sh
ts-binding :; npx typechain --target ethers-v5 --out-dir out/types/ './out/**/*.json'

# Deploy module in Polygon
deploy-keyper-env-polygon :; source .env && forge script script/DeployKeyperEnv.s.sol:DeployKeyperEnv --rpc-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY} --skip-simulation --broadcast --verify --etherscan-api-key ${POLYGONSCAN_KEY} -vvvv --with-gas-price 120000000000
deploy-palmera-env-polygon :; source .env && forge script script/DeployPalmeraEnv.s.sol:DeployPalmeraEnv --rpc-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY} --skip-simulation --broadcast --verify --etherscan-api-key ${POLYGONSCAN_KEY} -vvvv --with-gas-price 120000000000

# Deploy module
deploy-keyper-env :; source .env && forge script script/DeployKeyperEnv.s.sol:DeployKeyperEnv --rpc-url ${SEPOLIA_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast --verify --etherscan-api-key ${ETHERSCAN_KEY} -vvvv
deploy-palmera-env :; source .env && forge script script/DeployPalmeraEnv.s.sol:DeployPalmeraEnv --rpc-url ${SEPOLIA_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast --verify --etherscan-api-key ${ETHERSCAN_KEY} -vvvv

# Deploy module in fork-polygon
deploy-keyper-env-fork-polygon :; source .env && forge script script/DeployKeyperEnv.s.sol:DeployKeyperEnv --fork-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY}
deploy-palmera-env-fork-polygon :; source .env && forge script script/DeployPalmeraEnv.s.sol:DeployPalmeraEnv --fork-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY}

# Deploy New Safe
deploy-new-safe :; source .env && forge script script/DeployKeyperSafe.t.sol:DeployKeyperSafe --rpc-url ${GOERLI_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast -vvvv
deploy-new-safe :; source .env && forge script script/DeployPalmeraSafe.t.sol:DeployPalmeraSafe --rpc-url ${GOERLI_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast -vvvv

# Run Unit-Test in Fork polygon
test-fork-polygon :; source .env && forge script script/SkipExecutionOnBehalf.s.sol:SkipSeveralScenarios --fork-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast -vvvv
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PalmeraModule - Safe module for Palmera

This contract is a registry of keyper organization/squads setup on a Safe that can be used by specific accounts. For this the contract needs to be enabled as a module on the Safe that holds the assets that should be transferred.
This contract is a registry of palmera organization/squads setup on a Safe that can be used by specific accounts. For this the contract needs to be enabled as a module on the Safe that holds the assets that should be transferred.

## Tech requirements

Expand Down Expand Up @@ -40,7 +40,7 @@ forge test or make test-gas-report

### Deploy contracts

- Deploy Keypermodule
- Deploy Palmeramodule

Execute the command `deploy-module` located in the Makefile

Expand Down
96 changes: 48 additions & 48 deletions lcov.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TN:
SF:script/DeployKeyperEnv.s.sol
FN:14,DeployKeyperEnv.run
FNDA:0,DeployKeyperEnv.run
SF:script/DeployPalmeraEnv.s.sol
FN:14,DeployPalmeraEnv.run
FNDA:0,DeployPalmeraEnv.run
DA:15,0
DA:18,0
DA:19,0
Expand All @@ -22,13 +22,13 @@ BRF:0
BRH:0
end_of_record
TN:
SF:script/DeployKeyperRoles.t.sol
FN:11,DeployKeyperRoles.run
FNDA:0,DeployKeyperRoles.run
SF:script/DeployPalmeraRoles.t.sol
FN:11,DeployPalmeraRoles.run
FNDA:0,DeployPalmeraRoles.run
DA:13,0
DA:14,0
FN:17,DeployKeyperRoles.deploy
FNDA:0,DeployKeyperRoles.deploy
FN:17,DeployPalmeraRoles.deploy
FNDA:0,DeployPalmeraRoles.deploy
DA:18,0
DA:19,0
DA:20,0
Expand All @@ -40,9 +40,9 @@ BRF:0
BRH:0
end_of_record
TN:
SF:script/DeployKeyperSafe.t.sol
FN:10,DeployKeyperSafe.run
FNDA:0,DeployKeyperSafe.run
SF:script/DeployPalmeraSafe.t.sol
FN:10,DeployPalmeraSafe.run
FNDA:0,DeployPalmeraSafe.run
DA:11,0
DA:12,0
DA:13,0
Expand Down Expand Up @@ -920,9 +920,9 @@ BRF:0
BRH:0
end_of_record
TN:
SF:test/KeyperRolesHarness.t.sol
FN:11,KeyperRolesHarness.exposed_setupRoles
FNDA:1,KeyperRolesHarness.exposed_setupRoles
SF:test/PalmeraRolesHarness.t.sol
FN:11,PalmeraRolesHarness.exposed_setupRoles
FNDA:1,PalmeraRolesHarness.exposed_setupRoles
DA:12,1
FNF:1
FNH:1
Expand Down Expand Up @@ -969,16 +969,16 @@ BRF:0
BRH:0
end_of_record
TN:
SF:test/helpers/KeyperModuleHelper.t.sol
FN:25,KeyperModuleHelper.initHelper
FNDA:0,KeyperModuleHelper.initHelper
SF:test/helpers/PalmeraModuleHelper.t.sol
FN:25,PalmeraModuleHelper.initHelper
FNDA:0,PalmeraModuleHelper.initHelper
DA:26,0
DA:27,0
FN:30,KeyperModuleHelper.setSafe
FNDA:21,KeyperModuleHelper.setSafe
FN:30,PalmeraModuleHelper.setSafe
FNDA:21,PalmeraModuleHelper.setSafe
DA:31,21
FN:35,KeyperModuleHelper.encodeSignaturesKeyperTx
FNDA:17,KeyperModuleHelper.encodeSignaturesKeyperTx
FN:35,PalmeraModuleHelper.encodeSignaturesPalmeraTx
FNDA:17,PalmeraModuleHelper.encodeSignaturesPalmeraTx
DA:44,17
DA:45,17
DA:49,17
Expand All @@ -989,8 +989,8 @@ DA:56,17
DA:57,31
DA:60,17
DA:62,17
FN:66,KeyperModuleHelper.encodeInvalidSignaturesKeyperTx
FNDA:1,KeyperModuleHelper.encodeInvalidSignaturesKeyperTx
FN:66,PalmeraModuleHelper.encodeInvalidSignaturesPalmeraTx
FNDA:1,PalmeraModuleHelper.encodeInvalidSignaturesPalmeraTx
DA:75,1
DA:76,1
DA:80,1
Expand All @@ -999,12 +999,12 @@ DA:83,1
DA:84,2
DA:87,1
DA:89,1
FN:92,KeyperModuleHelper.createKeyperTxHash
FNDA:0,KeyperModuleHelper.createKeyperTxHash
FN:92,PalmeraModuleHelper.createPalmeraTxHash
FNDA:0,PalmeraModuleHelper.createPalmeraTxHash
DA:101,0
DA:104,0
FN:107,KeyperModuleHelper.createSafeProxy
FNDA:1,KeyperModuleHelper.createSafeProxy
FN:107,PalmeraModuleHelper.createSafeProxy
FNDA:1,PalmeraModuleHelper.createSafeProxy
DA:111,1
BRDA:111,0,0,-
BRDA:111,0,1,1
Expand Down Expand Up @@ -1034,13 +1034,13 @@ BRF:6
BRH:3
end_of_record
TN:
SF:test/helpers/KeyperSafeBuilder.t.sol
FN:14,KeyperSafeBuilder.setUpParams
FNDA:0,KeyperSafeBuilder.setUpParams
SF:test/helpers/PalmeraSafeBuilder.t.sol
FN:14,PalmeraSafeBuilder.setUpParams
FNDA:0,PalmeraSafeBuilder.setUpParams
DA:18,0
DA:19,0
FN:26,KeyperSafeBuilder.setupRootOrgAndOneSquad
FNDA:46,KeyperSafeBuilder.setupRootOrgAndOneSquad
FN:26,PalmeraSafeBuilder.setupRootOrgAndOneSquad
FNDA:46,PalmeraSafeBuilder.setupRootOrgAndOneSquad
DA:31,121
DA:32,121
DA:34,121
Expand All @@ -1051,8 +1051,8 @@ DA:40,121
DA:42,121
DA:43,121
DA:45,121
FN:52,KeyperSafeBuilder.setupRootWithTwoSquads
FNDA:1,KeyperSafeBuilder.setupRootWithTwoSquads
FN:52,PalmeraSafeBuilder.setupRootWithTwoSquads
FNDA:1,PalmeraSafeBuilder.setupRootWithTwoSquads
DA:57,1
DA:59,1
DA:62,1
Expand All @@ -1061,8 +1061,8 @@ DA:66,1
DA:67,1
DA:68,1
DA:70,1
FN:77,KeyperSafeBuilder.setupTwoRootOrgWithOneSquadEach
FNDA:12,KeyperSafeBuilder.setupTwoRootOrgWithOneSquadEach
FN:77,PalmeraSafeBuilder.setupTwoRootOrgWithOneSquadEach
FNDA:12,PalmeraSafeBuilder.setupTwoRootOrgWithOneSquadEach
DA:91,22
DA:93,22
DA:96,22
Expand All @@ -1076,8 +1076,8 @@ DA:109,22
DA:110,22
DA:111,22
DA:113,22
FN:122,KeyperSafeBuilder.setupTwoRootOrgWithOneSquadAndOneChildEach
FNDA:10,KeyperSafeBuilder.setupTwoRootOrgWithOneSquadAndOneChildEach
FN:122,PalmeraSafeBuilder.setupTwoRootOrgWithOneSquadAndOneChildEach
FNDA:10,PalmeraSafeBuilder.setupTwoRootOrgWithOneSquadAndOneChildEach
DA:140,10
DA:144,10
DA:145,10
Expand All @@ -1090,8 +1090,8 @@ DA:154,10
DA:155,10
DA:156,10
DA:158,10
FN:174,KeyperSafeBuilder.setupTwoOrgWithOneRootOneSquadAndOneChildEach
FNDA:5,KeyperSafeBuilder.setupTwoOrgWithOneRootOneSquadAndOneChildEach
FN:174,PalmeraSafeBuilder.setupTwoOrgWithOneRootOneSquadAndOneChildEach
FNDA:5,PalmeraSafeBuilder.setupTwoOrgWithOneRootOneSquadAndOneChildEach
DA:192,5
DA:194,5
DA:196,5
Expand All @@ -1105,24 +1105,24 @@ DA:207,5
DA:208,5
DA:209,5
DA:211,5
FN:227,KeyperSafeBuilder.setupOrgThreeTiersTree
FNDA:27,KeyperSafeBuilder.setupOrgThreeTiersTree
FN:227,PalmeraSafeBuilder.setupOrgThreeTiersTree
FNDA:27,PalmeraSafeBuilder.setupOrgThreeTiersTree
DA:236,42
DA:238,42
DA:241,42
DA:242,42
DA:244,42
DA:245,42
FN:256,KeyperSafeBuilder.setupOrgFourTiersTree
FNDA:11,KeyperSafeBuilder.setupOrgFourTiersTree
FN:256,PalmeraSafeBuilder.setupOrgFourTiersTree
FNDA:11,PalmeraSafeBuilder.setupOrgFourTiersTree
DA:270,15
DA:274,15
DA:276,15
DA:277,15
DA:279,15
DA:282,15
FN:293,KeyperSafeBuilder.setUpBaseOrgTree
FNDA:4,KeyperSafeBuilder.setUpBaseOrgTree
FN:293,PalmeraSafeBuilder.setUpBaseOrgTree
FNDA:4,PalmeraSafeBuilder.setUpBaseOrgTree
DA:309,4
DA:314,4
DA:315,4
Expand All @@ -1144,8 +1144,8 @@ DA:26,1
DA:27,1
DA:28,1
DA:29,1
FN:32,AttackerHelper.encodeSignaturesForAttackKeyperTx
FNDA:1,AttackerHelper.encodeSignaturesForAttackKeyperTx
FN:32,AttackerHelper.encodeSignaturesForAttackPalmeraTx
FNDA:1,AttackerHelper.encodeSignaturesForAttackPalmeraTx
DA:40,1
DA:41,1
DA:45,1
Expand Down
4 changes: 2 additions & 2 deletions libraries/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ library Constants {
0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;

// keccak256(
// "KeyperTx(address org,address superSafe,address targetSafe,address to,uint256 value,bytes data,uint8 operation,uint256 _nonce)"
// "PalmeraTx(address org,address superSafe,address targetSafe,address to,uint256 value,bytes data,uint8 operation,uint256 _nonce)"
// );
bytes32 internal constant KEYPER_TX_TYPEHASH =
bytes32 internal constant PALMERA_TX_TYPEHASH =
0x5576bff5f05f6e5452f02e4fe418b1519cb08f54fae3564c3a4d2a4706584d4e;

address internal constant FALLBACK_HANDLER =
Expand Down
4 changes: 2 additions & 2 deletions libraries/DataTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pragma solidity ^0.8.15;
/// @title Library DataTypes
/// @custom:security-contact [email protected]
library DataTypes {
/// @dev typos of Roles into Keyper Modules
/// @dev typos of Roles into Palmera Modules
enum Role {
SAFE_LEAD,
SAFE_LEAD_EXEC_ON_BEHALF_ONLY,
SAFE_LEAD_MODIFY_OWNERS_ONLY,
SUPER_SAFE,
ROOT_SAFE
}
/// @dev typos of squads into Keyper Modules
/// @dev typos of squads into Palmera Modules
enum Tier {
SQUAD, // 0
ROOT, // 1
Expand Down
10 changes: 5 additions & 5 deletions libraries/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {DataTypes} from "./DataTypes.sol";
/// @title Library DataTypes
/// @custom:security-contact [email protected]
library Errors {
/// @notice Error codes for the Keyper module
/// @dev Errors Keyper Modules
/// @notice Error codes for the Palmera module
/// @dev Errors Palmera Modules
/// @dev Error messages when the Org Hash (Dao's name) is not Registered
error OrgNotRegistered(bytes32 org);
/// @dev Error messages when the Squad(`squad`) is not Registered
Expand All @@ -28,8 +28,8 @@ library Errors {
error CannotDisconnectedSafeBeforeRemoveChild(uint256 children);
/// @dev Error messages when try to remove Squad before remove it's children, and show the Squad's children Squad Id's
error CannotRemoveSquadBeforeRemoveChild(uint256 children);
error CannotDisableKeyperModule(address module);
error CannotDisableKeyperGuard(address guard);
error CannotDisablePalmeraModule(address module);
error CannotDisablePalmeraGuard(address guard);
error SquadAlreadyRemoved();
/// @dev Error messages when the Caller is not Autorized to execute any action like Lead Safe
error NotAuthorizedAsNotSafeLead();
Expand All @@ -46,7 +46,7 @@ library Errors {
error OwnerNotFound();
/// @dev Error messages the Owner Already Exist into the Safe Owners
error OwnerAlreadyExists();
/// @dev Error messages when Fail try to create a new Safe with the Keyper Module Enabled
/// @dev Error messages when Fail try to create a new Safe with the Palmera Module Enabled
error CreateSafeProxyFailed();
/// @dev Error messages when Invalid Threshold is provided
error InvalidThreshold();
Expand Down
10 changes: 5 additions & 5 deletions libraries/Events.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library Events {
uint256 newSuperSafe
);

/// @dev Event Fire when Keyper Module execute a transaction on behalf of a Safe
/// @dev Event Fire when Palmera Module execute a transaction on behalf of a Safe
/// @param org Hash(DAO's name)
/// @param executor Address of the executor
/// @param target Address of the Target Safe
Expand All @@ -75,7 +75,7 @@ library Events {
bool result
);

/// @dev Event Fire when any Safe enable the Keyper Module
/// @dev Event Fire when any Safe enable the Palmera Module
event ModuleEnabled(address indexed safe, address indexed module);

/// @dev Event Fire when any Root Safe create a new Root Safe
Expand Down Expand Up @@ -154,8 +154,8 @@ library Events {
/// @param user Wallet to drop of the deny/allow list
event DroppedFromList(address indexed user);

/// @dev Event when a new keyperModule is setting up
/// @param keyperModule Address of the new keyperModule
/// @dev Event when a new palmeraModule is setting up
/// @param palmeraModule Address of the new palmeraModule
/// @param caller Address of the deployer
event KeyperModuleSetup(address keyperModule, address caller);
event PalmeraModuleSetup(address palmeraModule, address caller);
}
2 changes: 1 addition & 1 deletion script/DeployModuleWithMockedSafe.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract DeployModuleWithMockedSafe is Script {
vm.startBroadcast();
MockedContract masterCopyMocked = new MockedContract();
MockedContract proxyFactoryMocked = new MockedContract();
PalmeraModule keyperModule = new PalmeraModule(
PalmeraModule palmeraModule = new PalmeraModule(
address(masterCopyMocked),
address(proxyFactoryMocked),
rolesAuthority,
Expand Down
Loading

0 comments on commit 05ee7c3

Please sign in to comment.