Skip to content

Commit c9ecc25

Browse files
committed
Fix paths
1 parent 727a5d8 commit c9ecc25

9 files changed

Lines changed: 76 additions & 58 deletions

File tree

contracts/SecureAssetLocker.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.4;
3+
4+
import "@lukso/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol";
5+
6+
7+
contract SecureAssetLocker is LSP4DigitalAssetMetadata {
8+
9+
}

contracts/mocks/MockLSP7.sol

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.24;
3+
4+
contract MockLSP7 {
5+
mapping(address => uint256) balances;
6+
mapping(address => mapping(address => uint256)) public authorizedOperators;
7+
8+
function mint(address to, uint256 amount) external {
9+
balances[to] += amount;
10+
}
11+
12+
function authorizeOperator(address operator, uint256 amount) external {
13+
authorizedOperators[msg.sender][operator] = amount;
14+
}
15+
16+
function transfer(address from, address to, uint256 amount, bool, bytes memory) external {
17+
require(balances[from] >= amount, "Insufficient balance");
18+
if (from != msg.sender) {
19+
require(authorizedOperators[from][msg.sender] >= amount, "Not authorized");
20+
authorizedOperators[from][msg.sender] -= amount;
21+
}
22+
balances[from] -= amount;
23+
balances[to] += amount;
24+
}
25+
26+
function balanceOf(address account) external view returns (uint256) {
27+
return balances[account];
28+
}
29+
}

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
src = 'contracts'
33
out = 'out'
44
libs = ['lib']
5-
remappings = ['@lukso-smart-contracts/=lib/lsp-smart-contracts/contracts/']
5+
remappings = ["@lukso/=lib/lsp-smart-contracts/contracts/"]
66
optimizer = true
77
optimizer_runs = 200
88
solc_version = '0.8.24'

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

remappings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@lukso/=lib/lsp-smart-contracts/contracts/

script/Counter.s.sol

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Counter.sol

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/Counter.t.sol

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/SecureAssetLocker.t.sol

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.24;
3+
4+
import "forge-std/Test.sol";
5+
import "../contracts/SecureAssetLocker.sol";
6+
import "../contracts/mocks/MockLSP7.sol";
7+
8+
contract SecureAssetLockerTest is Test {
9+
SecureAssetLocker locker;
10+
MockLSP7 token;
11+
12+
function setUp() public {
13+
// Deploy a mock LSP7 token
14+
token = new MockLSP7();
15+
16+
// Mint tokens to owner
17+
token.mint(owner, 1000 ether);
18+
19+
// Deploy the SecureAssetLocker (with mock UP and KeyManager addresses)
20+
locker = new SecureAssetLocker(address(1), address(2));
21+
22+
23+
}
24+
25+
function testLockAssetSuccess() public {
26+
27+
}
28+
29+
30+
}

0 commit comments

Comments
 (0)