-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added oz dependencies and changed sol version
- Loading branch information
Showing
31 changed files
with
146 additions
and
1,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,5 @@ jobs: | |
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
forge test -vvvv | ||
id: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,7 @@ out/ | |
|
||
# Dotenv file | ||
.env | ||
|
||
|
||
# Soldeer | ||
/dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"solidity.compileUsingRemoteVersion": "v0.8.28+commit.7893614a" | ||
"solidity.compileUsingRemoteVersion": "v0.8.28+commit.7893614a", | ||
"editor.tabSize": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
[profile.default] | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
libs = ["lib", "dependencies"] | ||
|
||
[dependencies] | ||
forge-std = "1.9.5" | ||
"@openzeppelin-contracts" = "5.2.0-rc.1" | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.2.0-rc.1/ | ||
forge-std-1.9.5/=dependencies/forge-std-1.9.5/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[dependencies]] | ||
name = "@openzeppelin-contracts" | ||
version = "5.2.0-rc.1" | ||
url = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/5_2_0-rc_1_18-12-2024_19:26:33_contracts.zip" | ||
checksum = "0430f56c556a4864cb2c0f28edbd497304a1e367d30dd07942778bef3a0f7a5f" | ||
integrity = "17e24d71e2995a505f428ff1e4b514723175d8c6f7b84db6a96cfa31bc73fe23" | ||
|
||
[[dependencies]] | ||
name = "forge-std" | ||
version = "1.9.5" | ||
url = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_9_5_21-12-2024_15:04:05_forge-std-1.9.zip" | ||
checksum = "57ada736f383289db77fac4472d48f820e7c98172cf9b01681b0c37065ce043f" | ||
integrity = "4753ffdfa0dde40878372b6a4d8e8fd1648b190b33996896c8b92f6f1680850f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.28; | ||
|
||
|
||
contract Gateway { | ||
|
||
uint256 sendTokenFee = 1000000; | ||
|
||
function quoteSendTokenFee(address token, uint32 paraId, uint128 destinationFee) external view returns (uint256) { | ||
// Basic validation to use the parameters | ||
require(token != address(0), "Invalid token address"); | ||
require(paraId > 0, "Invalid paraId"); | ||
require(destinationFee > 0, "Invalid destination fee"); | ||
|
||
// mock the fee | ||
return sendTokenFee; | ||
} | ||
|
||
|
||
function setSendTokenFee(uint256 _fee) external { | ||
sendTokenFee = _fee; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Compatible with OpenZeppelin Contracts ^5.0.0 | ||
pragma solidity ^0.8.22; | ||
|
||
import {ERC20} from "src/ERC20.sol"; | ||
|
||
contract LSToken is ERC20("LSToken", "LSToken", 18) { | ||
|
||
address public owner; | ||
|
||
constructor(address _owner) { | ||
owner = _owner; | ||
} | ||
|
||
modifier onlyOwner() { | ||
require(owner == msg.sender); | ||
_; | ||
} | ||
|
||
function mint(address to, uint256 amount) public onlyOwner { | ||
_mint(to, amount); | ||
} | ||
|
||
function burn(address from, uint256 amount) public onlyOwner { | ||
_burn(from, amount); | ||
} | ||
|
||
function setOwner(address _owner) public onlyOwner { | ||
owner = _owner; | ||
} | ||
} |
Oops, something went wrong.