web3_code_hunt retweeted
React Native
New Architecture of React Native is really a power for both 👇
1. For your App
2. For sharpening your skill to be a Sr. React Native Engineer
I'm going to deep dive more 🚀
I have written the full flow of React Native Architecture here 👇medium.com/@anisurrahmanbup/…
web3_code_hunt retweeted
#web3security investigators!
🔗discuss about Contracts with Anonymous Token Teams
1️⃣ Accountability
2️⃣ Transparency
3️⃣ Review standards
4️⃣ Mitigating risks
5️⃣ Investor protection
1️⃣ Accountability:
When it comes to token development, it is crucial to have a known and identifiable team responsible for the project.
If the development team remains anonymous or operates within legal shelters, it becomes challenging to hold them accountable for any potential abuse or misconduct.
2️⃣ Transparency:
A known token development team promotes transparency within the project.
Users and investors can research and evaluate the team's credentials, expertise, and past experiences, allowing them to make informed decisions about whether to participate in the token ecosystem.
3️⃣ Review standards:
Contracts involving anonymous development teams or those residing in legal shelters should be subject to higher scrutiny.
Given the potential risks associated with such arrangements, it becomes imperative to conduct more rigorous reviews of the project's technical aspects, security measures, and compliance with relevant regulations.
4️⃣ Mitigating risks:
Requiring a higher standard of review for contracts with anonymous teams or those in legal shelters helps mitigate potential risks.
This includes reducing the likelihood of scams, fraudulent activities, or malicious intent, as well as ensuring the project is built on solid foundations.
5️⃣ Investor protection:
Holding the token development team accountable and implementing stricter review standards enhances investor protection.
It helps to safeguard against instances of abuse, fraud, or mismanagement, thereby fostering trust and confidence within the token ecosystem.
web3_code_hunt retweeted
#web3 BUG - Improper Input Validation 👇
If access control is about controlling who calls a function, input validation is about controlling what they call the contract with.
This usually comes down to forgetting to put the proper require statements in place.
Here is a rudimentary example👇
contract UnsafeBank {
mapping(address => uint256) public balances;
// allow depositing on other's behalf
function deposit(address for) public payable {
balances += msg.value;
}
function withdraw(address from, uint256 amount)
public {
require(balances[from] <= amount,
"insufficient balance");
balances[from] -= amount;
msg.sender.call{value: amout}("");
}
}
The contract above 👆 does check that you aren’t withdrawing more than you have in your account, but it doesn’t stop you from withdrawing from an arbitrary account.
✅ What is the difference between improper access control and improper input validation?
👉Improper access control means msg.sender does not have adequate restrictions. Improper input validation means the arguments to the function are not sufficiently sanitized. There is also an inverse to this anti-pattern: placing too much restriction on a function call.
web3_code_hunt retweeted
👇👇👇👇
#web3 BUG - Unexpected Ether Attack 👇
If you find this line of code in SMART Contract
- ❝ this.balance ❞
✅ Then may be there is a BUG in Smart Contract
Inside SMART Contract as the balance of the contract can be manipulated by hacker even without using any PAYABLE function of the contract.
A hacker can send some ETHER/ MATIC/ other tokens without payable by using 2 way.
Ways are 👇
1️⃣ Self-destructive/suicide attempt
2️⃣ Pre sent ETHER
👉 Self-destructive/suicide attempt --> of his (Hacker) own contract with setting your CONTRACT address as the receiver of the remaining ETHER/ MATIC balance of his suicided contract.
👉 Pre sent ETHER --> by pre calculating the ETHEREUM address of the newly deployed contract.
So, if you find the Vulnerability, just submit your PoC & get the Reward 💯
🫡 Stay connected with @auditx_eth team as it is trying to enable thousands of Auditors in this space by let the Auditors learn from their own Audit Experiences.
web3_code_hunt retweeted
#Web3 Auditors
Complete guide on
✅ FORMAL VERIFICATION
✅ SYMBOLIC EXECUTION
Let's jump details in this Video of @PatrickAlphaC boss youtu.be/izpoxfTSaFs
- an interview of @trailofbits 🫡
👉 Formal Verification is the act of proving or disproving a given property of a system using a mathematical model.
👉 Symbolic execution is one technique used for formal verification. using a mathematical model. it Convert Code -> Math.
web3_code_hunt retweeted
💯 @auditx_eth team has break down all of it's Mathematical terms in total 13 Threads
👉 All Complex terms of Compound PROTOCOL in 13 Threads teapawt.net/auditx_eth/status/1657…
Stay connected with @auditx_eth team 🚀
✅ 🔔 Web3 Auditors, here 13 #Threads, complete explanation of
- @compoundfinance White Paper 💯⏬
🔔 More you know DeFi, more you get BUG 🔔
1️⃣ 👉 Collateral factors + Borrowing capacity: teapawt.net/Anisur_072/status/1654…
web3_code_hunt retweeted
#web3 security enthusiasts
The - ❝ @compoundfinance ❞ PROTOCOL is best to start because
1️⃣ It is Clearly written
2️⃣ Perfectly Commented
3️⃣ DeFi terms are easy
4️⃣ Good Code Architecture
👉 All Complex terms of Compound PROTOCOL in 13 Threads teapawt.net/auditx_eth/statu…
✅ 🔔 Web3 Auditors, here 13 #Threads, complete explanation of
- @compoundfinance White Paper 💯⏬
🔔 More you know DeFi, more you get BUG 🔔
1️⃣ 👉 Collateral factors + Borrowing capacity: teapawt.net/Anisur_072/status/1654…
web3_code_hunt retweeted
#web3 BUG - Unexpected Ether Attack 👇
If you find this line of code in SMART Contract
- ❝ this.balance ❞
✅ Then may be there is a BUG in Smart Contract
Inside SMART Contract as the balance of the contract can be manipulated by hacker even without using any PAYABLE function of the contract.
A hacker can send some ETHER/ MATIC/ other tokens without payable by using 2 way.
Ways are 👇
1️⃣ Self-destructive/suicide attempt
2️⃣ Pre sent ETHER
👉 Self-destructive/suicide attempt --> of his (Hacker) own contract with setting your CONTRACT address as the receiver of the remaining ETHER/ MATIC balance of his suicided contract.
👉 Pre sent ETHER --> by pre calculating the ETHEREUM address of the newly deployed contract.
So, if you find the Vulnerability, just submit your PoC & get the Reward 💯
🫡 Stay connected with @auditx_eth team as it is trying to enable thousands of Auditors in this space by let the Auditors learn from their own Audit Experiences.
web3_code_hunt retweeted
#web3 BUG - Unexpected Ether Attack 👇
If you find this line of code in SMART Contract
- ❝ this.balance ❞
✅ Then may be there is a BUG in Smart Contract
Inside SMART Contract as the balance of the contract can be manipulated by hacker even without using any PAYABLE function of the contract.
A hacker can send some ETHER/ MATIC/ other tokens without payable by using 2 way.
Ways are 👇
1️⃣ Self-destructive/suicide attempt
2️⃣ Pre sent ETHER
👉 Self-destructive/suicide attempt --> of his (Hacker) own contract with setting your CONTRACT address as the receiver of the remaining ETHER/ MATIC balance of his suicided contract.
👉 Pre sent ETHER --> by pre calculating the ETHEREUM address of the newly deployed contract.
So, if you find the Vulnerability, just submit your PoC & get the Reward 💯
🫡 Stay connected with @auditx_eth team as it is trying to enable thousands of Auditors in this space by let the Auditors learn from their own Audit Experiences.
web3_code_hunt retweeted
#web3 security enthusiast
🔰Restricted token minting prevents abuse by malicious or compromised owners.
1) Tokens with limited minting capabilities restrict the ability of the token owner to create or generate new tokens.
2) This limitation is implemented to prevent malicious or compromised token owners from abusing their minting capabilities for personal gain or to manipulate the token's supply.
3) By limiting minting capabilities, the token ecosystem maintains integrity, prevents inflationary issues, and ensures a fair distribution of tokens.
4) Token holders can trust that the token supply remains controlled and that new tokens cannot be arbitrarily created by the token owner, promoting transparency and maintaining the token's value.
web3_code_hunt retweeted
#web3 security enthusiast
🔗Token is not upgradeable:
🔰Using an upgradeable smart contract makes it easier for developers to solve identified problems.
🔰only have to create a new execution contract and update the proxy contract to point away from the old contract.
With an option to fix bugs, smart contract developers can assure users of safety.
1️⃣ A token being non-upgradeable means that its rules and functionalities remain fixed once deployed on the blockchain.
2️⃣ Non-upgradeable tokens provide certainty and immutability as their properties and behavior cannot be altered or modified.
3️⃣ Upgradeable contracts, on the other hand, allow changes to be made, which could potentially impact token holders and the token's overall ecosystem.
4️⃣ Non-upgradeable tokens provide stability and consistency, ensuring that the token's rules and functionality remain unchanged throughout its existence.
web3_code_hunt retweeted
#web3 security enthusiast
➡️ ERC20 token
An ERC20 token is a standardized digital currency or token that operates on the Ethereum blockchain, allowing for seamless integration and interaction with various decentralized applications and services.
ERC20 conformity checks are like tests that make sure a token follows certain rules.
Slither, a special tool, has a feature called "slither-check-erc" that can do these tests for us.
🔰 Here are some things that slither-check-erc looks for:
(1) It checks if the "transfer" and "transfer From" functions give back a true or false answer. Some tokens don't do this, which can cause problems when using them in contracts.
(2) It checks if the token has certain functions like "name," "decimals," and "symbol." These functions are not always required, but if they are used, they should be there.
(3) It checks if the "decimals" function gives back a number less than 255. Some tokens might give back a bigger number by mistake, which can cause issues.
(4) It checks if the token protects against a known problem called the "ERC20 race condition."
This problem can let bad people steal tokens, so the token needs to be designed to prevent that.
web3_code_hunt retweeted
#web3 security researchers!
🔗discussion on Risks of ERC20 Extensions
1️⃣ When dealing with ERC20 extensions, it's important to manually review the contract behavior as it may deviate from the original ERC specification.
2️⃣ Look for external function calls in the transfer or transfer From functions, as these can introduce reentrancy vulnerabilities.
3️⃣ Take note if the token imposes a fee on transfers, as deflationary tokens can have unexpected effects.
4️⃣ Consider the potential interest earned from the token, as certain tokens distribute interest to holders, and failing to account for it may trap the interest within the contract.
Additionally, token scarcity is an important aspect to consider.
web3_code_hunt retweeted
#Web3 AUDITOR LOVERS
🔔 Audit Techniques Made Easy
🔊 Audit Techniques are like detectives that help us investigate project codebases. 💯
⏩ to be a good-level auditor
✅ Let's dive in and explore some of these techniques! detail below 👇
✅Stay connected with @auditx_eth team and learn more to improve auditing skills 🚀
1⃣ Specification Analysis: Just like reading a recipe, we carefully read the project's specifications.
It helps us understand what the code is supposed to do and if it matches the requirements.
Think of it as checking if all the ingredients are in the right place!
2⃣ Documentation Analysis: Documentation is like a guidebook for the code.
go through it, page by page, to make sure everything is clear and understandable.
It's like checking if the instructions are easy to follow and if there are any missing steps.
3⃣ Symbolic Checking: Symbolic checking is like solving a puzzle.
use special tools to explore all the possible paths the code can take.
It helps us make sure that the code doesn't get lost or go the wrong way. It's like drawing a map to reach the treasure!
4⃣ Manual Analysis: Manual analysis is like using our own eyes and brain to look for issues.
We search for things that the tools might miss.
It's like having a detective's intuition to find hidden problems and make the code even better.
🖥️🎯 So, just like a team of detectives, these Audit Techniques help us keep the code in tip-top shape and make sure it's the best it can be!
Happy coding! 🚀
web3_code_hunt retweeted
#web3 security enthusiast
discussion on ERC20 token:
An ERC20 token is a standardized digital currency or token that operates on the Ethereum blockchain, allowing for seamless integration and interaction with various decentralized applications and services.
ERC20 conformity checks are like tests that make sure a token follows certain rules.
Slither, a special tool, has a feature called "slither-check-erc" that can do these tests for us.
🔰Here are some things that slither-check-erc looks for:
(1) It checks if the "transfer" and "transfer From" functions give back a true or false answer. Some tokens don't do this, which can cause problems when using them in contracts.
(2) It checks if the token has certain functions like "name," "decimals," and "symbol." These functions are not always required, but if they are used, they should be there.
(3) It checks if the "decimals" function gives back a number less than 255. Some tokens might give back a bigger number by mistake, which can cause issues.
(4) It checks if the token protects against a known problem called the "ERC20 race condition."
This problem can let bad people steal tokens, so the token needs to be designed to prevent that.
web3_code_hunt retweeted
#Web3 Security Enthusiasts
🔔 Contract functions executing critical logic should have appropriate access control enforced via address checks. 💯
⏩ to be a good-level auditor
✅ Let's jump in details 👇
✅ Stay with @auditx_eth and learn more to improve your auditing skill 🚀
1⃣ Security Best Practices: When developing smart contracts, it's crucial to enforce proper access control for contract functions executing critical logic.
This can be achieved through address checks, such as owner or controller, often implemented using modifiers.
2⃣ Contract functions executing critical logic should have appropriate access control enforced via address checks (e.g. owner, controller, etc.) typically in modifiers.
This is a basic but essential security practice for smart contracts
3⃣ Missing checks allow attackers to control critical logic, such as changing contract parameters, transferring funds, pausing the contract, or even destroying it.
This can lead to severe financial losses or reputational damage for the contract owners and users
4⃣ Avoiding Vulnerabilities: Failing to include necessary address checks in contract functions can create vulnerabilities, leaving open doors for malicious actors.
Without proper access control, attackers can exploit these gaps and gain control over critical aspects of the contract.
5⃣ Access control is one of the most fundamental and important aspects of smart contract security.
It can make or break a project and affect its trustworthiness and sustainability. Don’t let your contract be the next victim of a missing check
web3_code_hunt retweeted
#Web3 security Enthusiasts
Only 4 Step, give 1 month on Each 👇
1️⃣ @PatrickAlphaC 32 hour Sol Course - youtu.be/gyMwXuJrbJQ
2️⃣ @TheSecureum mind map - github.com/x676f64/secureum-…
3️⃣ @SoloditOfficial Critical BUG reports - solodit.xyz
4️⃣ @code4rena Contests - code4rena.com
web3_code_hunt retweeted
BUG - Access Control
🤦♂️It seems like a simple mistake, but forgetting to place restrictions on who can call a sensitive function (like withdrawing ether or changing ownership) happens surprisingly often.
Even if a modifier is in place, there have been cases where the modifier was not implemented correctly, such as in the example below where the require statement is missing.
// DO NOT USE!
modifier onlyMinter {
minters[msg.sender] == true_;
}
This above 👆 code is a real example from this audit👇:
code4rena.com/reports/2023-0…
Here is another way access control can go wrong👇
function claimAirdrop(bytes32 calldata proof[]) {
bool verified = MerkleProof.verifyCalldata(proof,
merkleRoot, keccak256(abi.encode(msg.sender)));
require(verified, "not verified");
require(alreadyClaimed[msg.sender], "already
claimed");
_transfer(msg.sender, AIRDROP_AMOUNT);
}
In this case, “alreadyClaimed” is never set to true, so the claimant can issue call the function multiple times.
✅So as a smart contract engineers or auditors you all guys should be care full in the time of write smart contract
Stay with @auditx_eth and learn more to improve auditing skill
web3_code_hunt retweeted
❝ BUG - ADDRESS VULNERABILITY TRICKS ❞
When you see any of these 3 in Smart Contracts
1️⃣ msg.sender
2️⃣ tx.origin
3️⃣ this
👉 Are they properly used ?
1️⃣ msg.sender -> Address of Caller (Contract/EOA) who Called the contract which has line of code msg.sender
2️⃣ tx.origin -> The address of EOA who originated the transaction.
3️⃣ this --> The address of Contract who is currently running the line of code "this".
If you find these 3 were not correctly used then may be a Spoiler Contract could drain out all Assets from that Contract.
💯 Submit PoC & get your Reward 💰
web3_code_hunt retweeted
#web3 security enthusiast
Contract composition:
Keep the contract simple to avoid unnecessary complexity.
Complex token contracts need a higher level of review.
Use Slither's human-summary printer to identify complex code and make it easier to understand.
Ensure the contract uses SafeMath.
Contracts without SafeMath require a higher level of review.
Manually inspect the contract for SafeMath usage to ensure secure mathematical operations.
Limit the number of non-token-related functions in the contract.
Non-token-related functions increase the chances of issues.
Review the contract using Slither's contract-summary printer to get a broad overview of the code.
Have only one address for the token.
Tokens with multiple entry points for balance updates can cause internal bookkeeping issues.
For example, balances [token_address][msg.sender] may not accurately reflect the actual balance.
#Audit
#Etherum
#blockchain

















