diff --git a/tokenizerRendu/README.md b/tokenizerRendu/README.md index c26840f..4110fc9 100644 --- a/tokenizerRendu/README.md +++ b/tokenizerRendu/README.md @@ -8,11 +8,11 @@ Projet 42 — création et déploiement d’un **token** sur blockchain publique | Élément | Statut | |---------|--------| -| Smart contract (`code/`) | À compléter | -| Déploiement (`deployment/`) | À compléter | +| Smart contract (`code/`) | **FGC42Forge** + tests Hardhat | +| Déploiement (`deployment/`) | **Testnet** — voir [`deployment/addresses.json`](deployment/addresses.json) | | Documentation utilisateur (`documentation/`) | À compléter | -## Token (à compléter après déploiement) +## Token | Champ | Valeur | |-------|--------| @@ -20,8 +20,9 @@ Projet 42 — création et déploiement d’un **token** sur blockchain publique | **Symbole** | `FG42` | | **Standard** | **BEP-20** (BNB Smart Chain) — contrat Solidity via OpenZeppelin **`ERC20`** (même interface EVM ; BscScan affiche BEP-20 après deploy) | | **Réseau** | BNB Smart Chain **Testnet**, chainId `97` | -| **Adresse du contrat** | `0x...` | -| **Explorer** | *(ex. https://testnet.bscscan.com/address/0x...)* | +| **Adresse du contrat** | `0x0c76df26A1149fDc22C8f994975705271b070fF4` | +| **Explorer** | https://testnet.bscscan.com/address/0x0c76df26A1149fDc22C8f994975705271b070fF4 | +| **Deployer** | `0xB6bE1878BfaF1FFC8503E752b1D733Ad7b93603c` (`FGC_account`) | ## Choix techniques (à rédiger pour la soutenance) @@ -49,14 +50,15 @@ Exemple avec Hardhat dans `code/` : ```bash cd code npm install -npx hardhat compile +npx hardhat build npx hardhat test ``` -Déploiement (exemple) : +Déploiement (déjà effectué — pour reproduire, voir [`deployment/README.md`](deployment/README.md)) : ```bash -# depuis deployment/ ou via script documenté dans deployment/README.md +cd code +npx hardhat ignition deploy --network bscTestnet ignition/modules/FGC42Forge.ts ``` **Ne jamais committer** de clé privée. Utiliser un fichier `.env` local (voir `.env.example` si présent). @@ -65,7 +67,7 @@ Déploiement (exemple) : 1. Montrer le contrat sur l’**explorer** (adresse + token). 2. **Transfer** entre deux comptes de test. -3. Expliquer **owner** et les fonctions restreintes (ex. `mint` `onlyOwner`). +3. Expliquer **owner** (`Ownable`) : pas de `mint` public ; supply fixe au deploy. 4. Montrer que la **documentation/** permet d’utiliser le token sans ton aide. ## Bonus diff --git a/tokenizerRendu/code/ignition/deployments/chain-97/build-info/solc-0_8_34-943a77a0cebb814d9fff3e1a8821f687ea8028e0.json b/tokenizerRendu/code/ignition/deployments/chain-97/build-info/solc-0_8_34-943a77a0cebb814d9fff3e1a8821f687ea8028e0.json new file mode 100644 index 0000000..2916337 --- /dev/null +++ b/tokenizerRendu/code/ignition/deployments/chain-97/build-info/solc-0_8_34-943a77a0cebb814d9fff3e1a8821f687ea8028e0.json @@ -0,0 +1,69 @@ +{ + "_format": "hh3-sol-build-info-1", + "id": "solc-0_8_34-943a77a0cebb814d9fff3e1a8821f687ea8028e0", + "solcVersion": "0.8.34", + "solcLongVersion": "0.8.34+commit.80d5c536", + "compilerType": "solc", + "toolVersions": { + "hardhat": "3.20.0" + }, + "userSourceNameMap": { + "contracts/FGC42Forge.sol": "project/contracts/FGC42Forge.sol" + }, + "input": { + "language": "Solidity", + "settings": { + "evmVersion": "osaka", + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "evm.bytecode.linkReferences", + "evm.bytecode.object", + "evm.bytecode.opcodes", + "evm.bytecode.sourceMap", + "evm.deployedBytecode.immutableReferences", + "evm.deployedBytecode.linkReferences", + "evm.deployedBytecode.object", + "evm.deployedBytecode.opcodes", + "evm.deployedBytecode.sourceMap", + "evm.methodIdentifiers" + ] + } + }, + "remappings": [ + "project/:@openzeppelin/contracts/=npm/@openzeppelin/contracts@5.6.1/" + ] + }, + "sources": { + "npm/@openzeppelin/contracts@5.6.1/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "npm/@openzeppelin/contracts@5.6.1/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-721.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "npm/@openzeppelin/contracts@5.6.1/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * Both values are immutable: they can only be set once during construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /// @inheritdoc IERC20\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n /// @inheritdoc IERC20\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /// @inheritdoc IERC20\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Skips emitting an {Approval} event indicating an allowance update. This is not\n * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation sets the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the `transferFrom` operation can force the flag to\n * true using the following override:\n *\n * ```solidity\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance < type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n" + }, + "npm/@openzeppelin/contracts@5.6.1/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "npm/@openzeppelin/contracts@5.6.1/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "npm/@openzeppelin/contracts@5.6.1/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "project/contracts/FGC42Forge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.34;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/// @title FGC42Forge — jeton fongible pour BNB Smart Chain Testnet\n/// @notice Standard **BEP-20** (exigé sur BSC) : même interface que l’ERC-20 sur l’EVM.\n/// On importe OpenZeppelin `ERC20` ; après déploiement sur BSC, BscScan affiche un token BEP-20.\n/// Phrase soutenance : « BEP-20 sur la chaîne, implémenté via ERC20 OpenZeppelin. »\ncontract FGC42Forge is ERC20, Ownable {\n uint256 private constant INITIAL_SUPPLY = 1_000_000 * (10 ** 18);\n\n constructor() ERC20(\"FGC42Forge\", \"FG42\") Ownable(msg.sender) {\n _mint(msg.sender, INITIAL_SUPPLY);\n }\n}" + } + } + } +} \ No newline at end of file diff --git a/tokenizerRendu/code/ignition/deployments/chain-97/deployed_addresses.json b/tokenizerRendu/code/ignition/deployments/chain-97/deployed_addresses.json new file mode 100644 index 0000000..67ab6c5 --- /dev/null +++ b/tokenizerRendu/code/ignition/deployments/chain-97/deployed_addresses.json @@ -0,0 +1,3 @@ +{ + "FGC42ForgeModule#FGC42Forge": "0x0c76df26A1149fDc22C8f994975705271b070fF4" +} \ No newline at end of file diff --git a/tokenizerRendu/code/ignition/deployments/chain-97/journal.jsonl b/tokenizerRendu/code/ignition/deployments/chain-97/journal.jsonl new file mode 100644 index 0000000..49e0bd9 --- /dev/null +++ b/tokenizerRendu/code/ignition/deployments/chain-97/journal.jsonl @@ -0,0 +1,8 @@ + +{"chainId":97,"type":"DEPLOYMENT_INITIALIZE"} +{"artifactId":"FGC42ForgeModule#FGC42Forge","constructorArgs":[],"contractName":"FGC42Forge","dependencies":[],"from":"0xb6be1878bfaf1ffc8503e752b1d733ad7b93603c","futureId":"FGC42ForgeModule#FGC42Forge","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"FGC42ForgeModule#FGC42Forge","networkInteraction":{"data":"0x608060405234801561000f575f5ffd5b50336040518060400160405280600a8152602001694647433432466f72676560b01b8152506040518060400160405280600481526020016323239a1960e11b81525081600390816100609190610313565b50600461006d8282610313565b5050506001600160a01b03811661009e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6100a7816100c1565b506100bc3369d3c21bcecceda1000000610112565b6103f6565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03821661013b5760405163ec442f0560e01b81525f6004820152602401610095565b6101465f838361014a565b5050565b6001600160a01b038316610174578060025f82825461016991906103d1565b909155506101e49050565b6001600160a01b0383165f90815260208190526040902054818110156101c65760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610095565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166102005760028054829003905561021e565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161026391815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061029857607f821691505b6020821081036102b657634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561030e578282111561030e57805f5260205f20601f840160051c60208510156102e757505f5b90810190601f840160051c035f5b8181101561030a575f838201556001016102f5565b5050505b505050565b81516001600160401b0381111561032c5761032c610270565b6103408161033a8454610284565b846102bc565b6020601f821160018114610372575f831561035b5750848201515b5f19600385901b1c1916600184901b1784556103ca565b5f84815260208120601f198516915b828110156103a15787850151825560209485019460019092019101610381565b50848210156103be57868401515f19600387901b60f8161c191681555b505060018360011b0184555b5050505050565b808201808211156103f057634e487b7160e01b5f52601160045260245ffd5b92915050565b61080b806104035f395ff3fe608060405234801561000f575f5ffd5b50600436106100b1575f3560e01c8063715018a61161006e578063715018a6146101525780638da5cb5b1461015c57806395d89b4114610177578063a9059cbb1461017f578063dd62ed3e14610192578063f2fde38b146101ca575f5ffd5b806306fdde03146100b5578063095ea7b3146100d357806318160ddd146100f657806323b872dd14610108578063313ce5671461011b57806370a082311461012a575b5f5ffd5b6100bd6101dd565b6040516100ca919061067b565b60405180910390f35b6100e66100e13660046106cb565b61026d565b60405190151581526020016100ca565b6002545b6040519081526020016100ca565b6100e66101163660046106f3565b610286565b604051601281526020016100ca565b6100fa61013836600461072d565b6001600160a01b03165f9081526020819052604090205490565b61015a6102a9565b005b6005546040516001600160a01b0390911681526020016100ca565b6100bd6102bc565b6100e661018d3660046106cb565b6102cb565b6100fa6101a036600461074d565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b61015a6101d836600461072d565b6102d8565b6060600380546101ec9061077e565b80601f01602080910402602001604051908101604052809291908181526020018280546102189061077e565b80156102635780601f1061023a57610100808354040283529160200191610263565b820191905f5260205f20905b81548152906001019060200180831161024657829003601f168201915b5050505050905090565b5f3361027a81858561031a565b60019150505b92915050565b5f3361029385828561032c565b61029e8585856103a8565b506001949350505050565b6102b1610405565b6102ba5f610432565b565b6060600480546101ec9061077e565b5f3361027a8185856103a8565b6102e0610405565b6001600160a01b03811661030e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61031781610432565b50565b6103278383836001610483565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198110156103a2578181101561039457604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610305565b6103a284848484035f610483565b50505050565b6001600160a01b0383166103d157604051634b637e8f60e11b81525f6004820152602401610305565b6001600160a01b0382166103fa5760405163ec442f0560e01b81525f6004820152602401610305565b610327838383610555565b6005546001600160a01b031633146102ba5760405163118cdaa760e01b8152336004820152602401610305565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b0384166104ac5760405163e602df0560e01b81525f6004820152602401610305565b6001600160a01b0383166104d557604051634a1406b160e11b81525f6004820152602401610305565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156103a257826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161054791815260200190565b60405180910390a350505050565b6001600160a01b03831661057f578060025f82825461057491906107b6565b909155506105ef9050565b6001600160a01b0383165f90815260208190526040902054818110156105d15760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610305565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661060b57600280548290039055610629565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161066e91815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146106c6575f5ffd5b919050565b5f5f604083850312156106dc575f5ffd5b6106e5836106b0565b946020939093013593505050565b5f5f5f60608486031215610705575f5ffd5b61070e846106b0565b925061071c602085016106b0565b929592945050506040919091013590565b5f6020828403121561073d575f5ffd5b610746826106b0565b9392505050565b5f5f6040838503121561075e575f5ffd5b610767836106b0565b9150610775602084016106b0565b90509250929050565b600181811c9082168061079257607f821691505b6020821081036107b057634e487b7160e01b5f52602260045260245ffd5b50919050565b8082018082111561028057634e487b7160e01b5f52601160045260245ffdfea2646970667358221220a7e8ccba269283db90216d0c6830f4998fa131add78c4bab8c808c55e22f76d964736f6c63430008220033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"FGC42ForgeModule#FGC42Forge","networkInteractionId":1,"nonce":0,"type":"TRANSACTION_PREPARE_SEND"} +{"futureId":"FGC42ForgeModule#FGC42Forge","networkInteractionId":1,"nonce":0,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"100000000"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"100000000"}},"hash":"0xb6a0ec09d4db0e9f0686aca6ad5d8ca71cecaf8d43405eeed214736bb8574072"},"type":"TRANSACTION_SEND"} +{"futureId":"FGC42ForgeModule#FGC42Forge","hash":"0xb6a0ec09d4db0e9f0686aca6ad5d8ca71cecaf8d43405eeed214736bb8574072","networkInteractionId":1,"receipt":{"blockHash":"0x81a08043ff4aeede7889cb12f746f90a3840fecd79ce713950ada9260045a243","blockNumber":137872368,"contractAddress":"0x0c76df26A1149fDc22C8f994975705271b070fF4","logs":[{"address":"0x0c76df26A1149fDc22C8f994975705271b070fF4","data":"0x","logIndex":40,"topics":["0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000b6be1878bfaf1ffc8503e752b1d733ad7b93603c"]},{"address":"0x0c76df26A1149fDc22C8f994975705271b070fF4","data":"0x00000000000000000000000000000000000000000000d3c21bcecceda1000000","logIndex":41,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000b6be1878bfaf1ffc8503e752b1d733ad7b93603c"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"FGC42ForgeModule#FGC42Forge","result":{"address":"0x0c76df26A1149fDc22C8f994975705271b070fF4","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} \ No newline at end of file diff --git a/tokenizerRendu/deployment/addresses.json b/tokenizerRendu/deployment/addresses.json new file mode 100644 index 0000000..adea8f4 --- /dev/null +++ b/tokenizerRendu/deployment/addresses.json @@ -0,0 +1,11 @@ +{ + "network": "bscTestnet", + "chainId": 97, + "contractName": "FGC42Forge", + "tokenName": "FGC42Forge", + "symbol": "FG42", + "address": "0x0c76df26A1149fDc22C8f994975705271b070fF4", + "deployedAt": "2026-10-20", + "deployer": "0xB6bE1878BfaF1FFC8503E752b1D733Ad7b93603c", + "explorer": "https://testnet.bscscan.com/address/0x0c76df26A1149fDc22C8f994975705271b070fF4" +}