Skip to content

Commit

Permalink
Merge branch 'jt/sc-14515/sc-aave-v3-add-missing-operations' into jt/…
Browse files Browse the repository at this point in the history
…sc-14516/sc-spark-add-missing-operations-and-strategies
  • Loading branch information
zerotucks committed Feb 28, 2024
2 parents 1a5aa4c + 9cae822 commit 7937812
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/deploy-configurations/configs/arbitrum.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const config: SystemConfig = {
},
CollectFee: {
name: 'CollectFee',
deploy: true,
deploy: false,
address: '',
serviceRegistryName: SERVICE_REGISTRY_NAMES.common.COLLECT_FEE,
history: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-configurations/configs/base.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const config: SystemConfig = {
},
CollectFee: {
name: 'CollectFee',
deploy: true,
deploy: false,
address: '',
serviceRegistryName: SERVICE_REGISTRY_NAMES.common.COLLECT_FEE,
history: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ contract CollectFee is Executable, UseStorageSlot, UseRegistry {
using Read for StorageSlot.TransactionStorage;

// Fee percentage (e.g., 1% = 100, 0.5% = 50)
uint256 public feePercentage;
address public feeRecipient;
uint256 public immutable feePercentage;
address public immutable feeRecipient;
uint256 constant DIVISOR = 10000;

constructor(address _registry, uint256 _feePercentage, address _feeRecipient) UseRegistry(ServiceRegistry(_registry)) {
feePercentage = _feePercentage;
Expand All @@ -33,7 +34,7 @@ contract CollectFee is Executable, UseStorageSlot, UseRegistry {
function execute(bytes calldata data, uint8[] memory paramsMap) external payable override {
address asset = parseInputs(data);
uint256 transactionAmount = store().readUint(bytes32(0), paramsMap[0]);
uint256 feeAmount = (transactionAmount * feePercentage) / 10000;
uint256 feeAmount = (transactionAmount * feePercentage) / DIVISOR;

// Transfer fee from the user's proxy to the feeRecipient
IERC20(asset).safeTransferFrom(msg.sender, feeRecipient, feeAmount);
Expand Down

0 comments on commit 7937812

Please sign in to comment.