-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dadde0e
commit 88c329e
Showing
7 changed files
with
239 additions
and
6 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
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,27 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
/* | ||
Parameters.sol - Paymaster | ||
Copyright (C) 2023-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Paymaster is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Paymaster is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with Paymaster. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.18; | ||
|
||
|
||
error SchainPriceIsNotSet(); | ||
error SkaleTokenIsNotSet(); | ||
error SklPriceIsNotSet(); |
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: AGPL-3.0-only | ||
|
||
/* | ||
Replenishment.sol - Paymaster | ||
Copyright (C) 2023-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Paymaster is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Paymaster is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with Paymaster. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.18; | ||
|
||
|
||
error ReplenishmentPeriodIsTooBig(); | ||
error TooSmallAllowance( | ||
address spender, | ||
uint256 required, | ||
uint256 allowed | ||
); | ||
error TransferFailure(); |
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,33 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
/* | ||
Skl.sol - Paymaster | ||
Copyright (C) 2023-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Paymaster is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Paymaster is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with Paymaster. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.18; | ||
|
||
|
||
type SKL is uint256; | ||
|
||
using { | ||
sklLess as < | ||
} for SKL global; | ||
|
||
function sklLess(SKL left, SKL right) pure returns (bool result) { | ||
return SKL.unwrap(left) < SKL.unwrap(right); | ||
} |
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,33 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
/* | ||
Usd.sol - Paymaster | ||
Copyright (C) 2023-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Paymaster is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Paymaster is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with Paymaster. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.18; | ||
|
||
|
||
type USD is uint256; | ||
|
||
function usdEquals(USD a, USD b) pure returns (bool result) { | ||
return USD.unwrap(a) == USD.unwrap(b); | ||
} | ||
|
||
using { | ||
usdEquals as == | ||
} for USD global; |