-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/subdomain-registrar
- Loading branch information
Showing
18 changed files
with
978 additions
and
41 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'yarn' | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- name: Run test | ||
run: yarn test | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'yarn' | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- name: Run deploy | ||
run: yarn test:deploy | ||
env: | ||
BATCH_GATEWAY_URLS: '["https://universal-offchain-unwrapper.ens-cf.workers.dev/"]' |
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ~0.8.17; | ||
|
||
import "./ETHRegistrarController.sol"; | ||
import "./IBulkRenewal.sol"; | ||
import "./IPriceOracle.sol"; | ||
|
||
import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; | ||
|
||
contract StaticBulkRenewal is IBulkRenewal { | ||
ETHRegistrarController controller; | ||
|
||
constructor(ETHRegistrarController _controller) { | ||
controller = _controller; | ||
} | ||
|
||
function rentPrice( | ||
string[] calldata names, | ||
uint256 duration | ||
) external view override returns (uint256 total) { | ||
uint256 length = names.length; | ||
for (uint256 i = 0; i < length; ) { | ||
IPriceOracle.Price memory price = controller.rentPrice( | ||
names[i], | ||
duration | ||
); | ||
unchecked { | ||
++i; | ||
total += (price.base + price.premium); | ||
} | ||
} | ||
} | ||
|
||
function renewAll( | ||
string[] calldata names, | ||
uint256 duration | ||
) external payable override { | ||
uint256 length = names.length; | ||
uint256 total; | ||
for (uint256 i = 0; i < length; ) { | ||
IPriceOracle.Price memory price = controller.rentPrice( | ||
names[i], | ||
duration | ||
); | ||
uint256 totalPrice = price.base + price.premium; | ||
controller.renew{value: totalPrice}(names[i], duration); | ||
unchecked { | ||
++i; | ||
total += totalPrice; | ||
} | ||
} | ||
// Send any excess funds back | ||
payable(msg.sender).transfer(address(this).balance); | ||
} | ||
|
||
function supportsInterface( | ||
bytes4 interfaceID | ||
) external pure returns (bool) { | ||
return | ||
interfaceID == type(IERC165).interfaceId || | ||
interfaceID == type(IBulkRenewal).interfaceId; | ||
} | ||
} |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
158 changes: 158 additions & 0 deletions
158
deployments/goerli/solcInputs/ad37cc3cd3f1925923b5003f9803ae69.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
158 changes: 158 additions & 0 deletions
158
deployments/mainnet/solcInputs/ad37cc3cd3f1925923b5003f9803ae69.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.