-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
24 changed files
with
64 additions
and
568 deletions.
There are no files selected for viewing
70 changes: 35 additions & 35 deletions
70
contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnVulnerableDeFi.sol
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,44 +1,44 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
import { ERC721Burnable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | ||
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; | ||
// import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
// import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
// import { ERC721Burnable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | ||
// import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; | ||
|
||
/** | ||
* @title DamnValuableToken | ||
* @author Damn Vulnerable DeFi (https://damnvulnerabledefi.xyz) | ||
*/ | ||
// /** | ||
// * @title DamnValuableToken | ||
// * @author Damn Vulnerable DeFi (https://damnvulnerabledefi.xyz) | ||
// */ | ||
|
||
contract DamnValuableToken is ERC20 { | ||
constructor() ERC20("DamnValuableToken", "DVT") { | ||
_mint(msg.sender, type(uint256).max); | ||
} | ||
} | ||
// contract DamnValuableToken is ERC20 { | ||
// constructor() ERC20("DamnValuableToken", "DVT") { | ||
// _mint(msg.sender, type(uint256).max); | ||
// } | ||
// } | ||
|
||
/** | ||
* @title DamnValuableNFT | ||
* @author Damn Vulnerable DeFi (https://damnvulnerabledefi.xyz) | ||
* @notice Implementation of a mintable and burnable NFT with role-based access controls | ||
*/ | ||
contract DamnValuableNFT is ERC721, ERC721Burnable, AccessControl { | ||
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); | ||
uint256 public tokenIdCounter; | ||
// /** | ||
// * @title DamnValuableNFT | ||
// * @author Damn Vulnerable DeFi (https://damnvulnerabledefi.xyz) | ||
// * @notice Implementation of a mintable and burnable NFT with role-based access controls | ||
// */ | ||
// contract DamnValuableNFT is ERC721, ERC721Burnable, AccessControl { | ||
// bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); | ||
// uint256 public tokenIdCounter; | ||
|
||
constructor() ERC721("DamnValuableNFT", "DVNFT") { | ||
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); | ||
_grantRole(MINTER_ROLE, msg.sender); | ||
} | ||
// constructor() ERC721("DamnValuableNFT", "DVNFT") { | ||
// _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); | ||
// _grantRole(MINTER_ROLE, msg.sender); | ||
// } | ||
|
||
function safeMint(address to) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) { | ||
tokenId = tokenIdCounter; | ||
_safeMint(to, tokenId); | ||
++tokenIdCounter; | ||
} | ||
// function safeMint(address to) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) { | ||
// tokenId = tokenIdCounter; | ||
// _safeMint(to, tokenId); | ||
// ++tokenIdCounter; | ||
// } | ||
|
||
// The following functions are overrides required by Solidity. | ||
function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { | ||
return super.supportsInterface(interfaceId); | ||
} | ||
} | ||
// // The following functions are overrides required by Solidity. | ||
// function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { | ||
// return super.supportsInterface(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; |
110 changes: 0 additions & 110 deletions
110
contracts/CTF/Damn-Vulnerable-DeFi/08.Puppet/08.Puppet.sol
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; |
74 changes: 0 additions & 74 deletions
74
contracts/CTF/Damn-Vulnerable-DeFi/09.Puppet-V2/PuppetV2Pool.sol
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
File renamed without changes.
File renamed without changes.
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 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; |
44 changes: 0 additions & 44 deletions
44
contracts/CTF/Damn-Vulnerable-DeFi/13.Wallet-Mining/AuthorizerUpgradeable.sol
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.