Skip to content

Commit

Permalink
Update airdrop function names (#496)
Browse files Browse the repository at this point in the history
update airdrop function name
  • Loading branch information
kumaryash90 authored Sep 6, 2023
1 parent 2b97b02 commit 35c85e0
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface IAirdropERC1155 {
* @param tokenOwner The owner of the the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdrop(
function airdropERC1155(
address tokenAddress,
address tokenOwner,
AirdropContent[] calldata contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface IAirdropERC20 {
* @param tokenOwner The owner of the the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdrop(
function airdropERC20(
address tokenAddress,
address tokenOwner,
AirdropContent[] calldata contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/interface/airdrop/IAirdropERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface IAirdropERC721 {
* @param tokenOwner The owner of the the tokens to transfer.
* @param contents List containing recipient, tokenId to airdrop.
*/
function airdrop(
function airdropERC721(
address tokenAddress,
address tokenOwner,
AirdropContent[] calldata contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract AirdropERC1155 is
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _contents List containing recipient, tokenId and amounts to airdrop.
*/
function airdrop(
function airdropERC1155(
address _tokenAddress,
address _tokenOwner,
AirdropContent[] calldata _contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contract AirdropERC20 is
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _contents List containing recipient, tokenId and amounts to airdrop.
*/
function airdrop(
function airdropERC20(
address _tokenAddress,
address _tokenOwner,
AirdropContent[] calldata _contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/prebuilts/unaudited/airdrop/AirdropERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract AirdropERC721 is
* @param _tokenOwner The owner of the the tokens to transfer.
* @param _contents List containing recipient, tokenId to airdrop.
*/
function airdrop(
function airdropERC721(
address _tokenAddress,
address _tokenOwner,
AirdropContent[] calldata _contents
Expand Down
6 changes: 3 additions & 3 deletions src/test/airdrop/AirdropERC1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract AirdropERC1155Test is BaseTest {

function test_state_airdrop() public {
vm.prank(deployer);
drop.airdrop(address(erc1155), address(tokenOwner), _contentsOne);
drop.airdropERC1155(address(erc1155), address(tokenOwner), _contentsOne);

for (uint256 i = 0; i < countOne; i++) {
assertEq(erc1155.balanceOf(_contentsOne[i].recipient, i % 5), 5);
Expand All @@ -71,15 +71,15 @@ contract AirdropERC1155Test is BaseTest {
function test_revert_airdrop_notOwner() public {
vm.prank(address(25));
vm.expectRevert("Not authorized.");
drop.airdrop(address(erc1155), address(tokenOwner), _contentsOne);
drop.airdropERC1155(address(erc1155), address(tokenOwner), _contentsOne);
}

function test_revert_airdrop_notApproved() public {
tokenOwner.setApprovalForAllERC1155(address(erc1155), address(drop), false);

vm.startPrank(deployer);
vm.expectRevert("Not balance or approved");
drop.airdrop(address(erc1155), address(tokenOwner), _contentsOne);
drop.airdropERC1155(address(erc1155), address(tokenOwner), _contentsOne);
vm.stopPrank();
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/airdrop/AirdropERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract AirdropERC20Test is BaseTest {

function test_state_airdrop() public {
vm.prank(deployer);
drop.airdrop(address(erc20), address(tokenOwner), _contentsOne);
drop.airdropERC20(address(erc20), address(tokenOwner), _contentsOne);

for (uint256 i = 0; i < countOne; i++) {
assertEq(erc20.balanceOf(_contentsOne[i].recipient), _contentsOne[i].amount);
Expand All @@ -60,13 +60,13 @@ contract AirdropERC20Test is BaseTest {
function test_revert_airdrop_insufficientValue() public {
vm.prank(deployer);
vm.expectRevert("Insufficient native token amount");
drop.airdrop(CurrencyTransferLib.NATIVE_TOKEN, address(tokenOwner), _contentsOne);
drop.airdropERC20(CurrencyTransferLib.NATIVE_TOKEN, address(tokenOwner), _contentsOne);
}

function test_revert_airdrop_notOwner() public {
vm.startPrank(address(25));
vm.expectRevert("Not authorized.");
drop.airdrop(address(erc20), address(tokenOwner), _contentsOne);
drop.airdropERC20(address(erc20), address(tokenOwner), _contentsOne);
vm.stopPrank();
}

Expand All @@ -75,7 +75,7 @@ contract AirdropERC20Test is BaseTest {

vm.startPrank(deployer);
vm.expectRevert("Not balance or allowance");
drop.airdrop(address(erc20), address(tokenOwner), _contentsOne);
drop.airdropERC20(address(erc20), address(tokenOwner), _contentsOne);
vm.stopPrank();
}
}
Expand Down Expand Up @@ -118,7 +118,7 @@ contract AirdropERC20AuditTest is BaseTest {

function test_process_payments_with_non_compliant_token() public {
vm.prank(deployer);
drop.airdrop(address(erc20_nonCompliant), address(tokenOwner), _contentsOne);
drop.airdropERC20(address(erc20_nonCompliant), address(tokenOwner), _contentsOne);

// check balances after airdrop
for (uint256 i = 0; i < countOne; i++) {
Expand Down
6 changes: 3 additions & 3 deletions src/test/airdrop/AirdropERC721.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract AirdropERC721Test is BaseTest {

function test_state_airdrop() public {
vm.prank(deployer);
drop.airdrop(address(erc721), address(tokenOwner), _contentsOne);
drop.airdropERC721(address(erc721), address(tokenOwner), _contentsOne);

for (uint256 i = 0; i < 1000; i++) {
assertEq(erc721.ownerOf(i), _contentsOne[i].recipient);
Expand All @@ -56,15 +56,15 @@ contract AirdropERC721Test is BaseTest {
function test_revert_airdrop_notOwner() public {
vm.prank(address(25));
vm.expectRevert("Not authorized.");
drop.airdrop(address(erc721), address(tokenOwner), _contentsOne);
drop.airdropERC721(address(erc721), address(tokenOwner), _contentsOne);
}

function test_revert_airdrop_notApproved() public {
tokenOwner.setApprovalForAllERC721(address(erc721), address(drop), false);

vm.startPrank(deployer);
vm.expectRevert("Not owner or approved");
drop.airdrop(address(erc721), address(tokenOwner), _contentsOne);
drop.airdropERC721(address(erc721), address(tokenOwner), _contentsOne);
vm.stopPrank();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/benchmark/AirdropERC1155Benchmark.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ contract AirdropERC1155BenchmarkTest is BaseTest {
vm.pauseGasMetering();
vm.prank(deployer);
vm.resumeGasMetering();
drop.airdrop(address(erc1155), address(tokenOwner), _contentsOne);
drop.airdropERC1155(address(erc1155), address(tokenOwner), _contentsOne);
}
}
2 changes: 1 addition & 1 deletion src/test/benchmark/AirdropERC20Benchmark.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ contract AirdropERC20BenchmarkTest is BaseTest {
vm.pauseGasMetering();
vm.prank(deployer);
vm.resumeGasMetering();
drop.airdrop(address(erc20), address(tokenOwner), _contentsOne);
drop.airdropERC20(address(erc20), address(tokenOwner), _contentsOne);
}
}
2 changes: 1 addition & 1 deletion src/test/benchmark/AirdropERC721Benchmark.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ contract AirdropERC721BenchmarkTest is BaseTest {
vm.pauseGasMetering();
vm.prank(deployer);
vm.resumeGasMetering();
drop.airdrop(address(erc721), address(tokenOwner), _contentsOne);
drop.airdropERC721(address(erc721), address(tokenOwner), _contentsOne);
}
}

0 comments on commit 35c85e0

Please sign in to comment.