Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Languages/en/S03_Centralization_en/Centralization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Centralization is ERC20, Ownable {
constructor() ERC20("Centralization", "Cent") {
constructor() ERC20("Centralization", "Cent") Ownable(msg.sender) {
address exposedAccount = 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2;
transferOwnership(exposedAccount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";
// Access Control Exploit Example
contract AccessControlExploit is ERC20, Ownable {
// Constructor: Initialize token name and symbol
constructor() ERC20("Wrong Access", "WA") {}
constructor() ERC20("Wrong Access", "WA") Ownable(msg.sender) {}

// Bad mint function without access control
function badMint(address to, uint amount) public {
Expand Down
2 changes: 1 addition & 1 deletion Languages/en/S10_Honeypot_en/Honeypot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";
contract HoneyPot is ERC20, Ownable {
address public pair;
// Constructor: Initialize token name and symbol
constructor() ERC20("HoneyPot", "Pi Xiu") {
constructor() ERC20("HoneyPot", "Pi Xiu") Ownable(msg.sender) {
address factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; // goerli uniswap v2 factory
address tokenA = address(this); // Honeypot token address
address tokenB = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6; // goerli WETH
Expand Down
2 changes: 1 addition & 1 deletion Languages/pt-br/S03_Centralization/Centralization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Centralization is ERC20, Ownable {
constructor() ERC20("Centralization", "Cent") {
constructor() ERC20("Centralization", "Cent") Ownable(msg.sender) {
address exposedAccount = 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2;
transferOwnership(exposedAccount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";
// Exemplo de erro de gerenciamento de permissões
contract AccessControlExploit is ERC20, Ownable {
// Construtor: inicializa o nome e o código do token
constructor() ERC20("Wrong Access", "WA") {}
constructor() ERC20("Wrong Access", "WA") Ownable(msg.sender) {}

// Função mint incorreta, sem restrição de permissão
function badMint(address to, uint amount) public {
Expand Down