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
const CryptoJS = require('crypto-js'); | |
/** | |
* Hashes a given input using the SHA-256 algorithm. | |
* | |
* @param {string} data - The input data to be hashed. | |
* @returns {string} - The resulting SHA-256 hash in hexadecimal format. | |
*/ | |
function hash(data) { | |
return CryptoJS.SHA256(data).toString(CryptoJS.enc.Hex); |
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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.25; | |
contract MappingStorageTest { | |
uint256 a; | |
uint256 b; | |
mapping(string => address) private addresses; | |
constructor() { | |
a = 20; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.2 <0.9.0; | |
import "hardhat/console.sol"; | |
interface IFoo { | |
// Interface is returning data but the try/catch isn’t looking for it | |
function f() external view returns (uint256); | |
} | |
contract Foo { |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
import "hardhat/console.sol"; | |
contract ContractB { | |
function triggerPanic() external pure returns (uint256 c) { | |
uint256 a = 1; | |
uint256 b = 0; | |
c = a / b; // This will trigger a Panic error (division by zero) |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract ContractB { | |
function exampleFunction() external view { | |
// here | |
} | |
} |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract ContractB { | |
function outOfBounds(uint256 index) external view { | |
// | |
} | |
} |
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
use argon2::{Argon2, PasswordHash}; | |
use axum_extra::extract::cookie::{Cookie, SameSite}; | |
use axum_extra::extract::CookieJar; | |
async fn login_user( | |
ctx: State<ApiContext>, | |
Json(data): Json<LoginUser>, | |
) -> Result<(CookieJar, Json<LoginResponse>)> { | |
let user = models::user::get_user_pass_hash(&ctx.db, &data.email) | |
.await? |
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
import schedule from 'node-schedule'; | |
const publishPost = (postId: string, isScheduled: boolean, dateTime: string) => { | |
if (isScheduled) { | |
let date = extractDateParam(new Date(dateTime)); | |
const { year, month, hours, minutes, seconds } = date; | |
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
use std::net::{TcpListener, TcpStream}; | |
use std::io::{Read, Write}; | |
/// Handles an incoming client TCP stream. | |
/// | |
/// # Arguments | |
/// | |
/// * `stream` - The TCP stream for the connected client. | |
/// | |
/// # Panics |
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
[ | |
{ | |
"code": "044", | |
"bankName": "Access Bank Nigeria Plc" | |
}, | |
{ | |
"code": "063", | |
"bankName": "Diamond Bank Plc" | |
}, | |
{ |
NewerOlder