ton-blockchain / bridge-solidity Goto Github PK
View Code? Open in Web Editor NEWThis project forked from emelyanenkok/toncoin-bridge-evm-side
TON-EVM Toncoin bridge - Solidity smart contracts
License: GNU General Public License v3.0
This project forked from emelyanenkok/toncoin-bridge-evm-side
TON-EVM Toncoin bridge - Solidity smart contracts
License: GNU General Public License v3.0
The solidity version 0.7.4 does not automatically check numbers for overflows/underflows.
There are 3 places in the bridge solidity code that are potentially not checked for overflows:
Method increaseAllowance
bridge-solidity/contracts/ERC20.sol
Line 169 in 652e0e9
Since this method can only be called by the account owner himself, there is no critical exploitation.
Method _transfer
bridge-solidity/contracts/ERC20.sol
Line 218 in 652e0e9
The initial emission of Toncoins is 5 billion (5^18 in nanocoins).
The emission of Toncoins from validation are equal to about a few percent per year of the total emission.
The balance is stored in 256-bit uint with max number 2^256 โ 1 ~ 1e77
Thus, in a real situation, overflow cannot occur.
Method _mint
bridge-solidity/contracts/ERC20.sol
Line 237 in 652e0e9
bridge-solidity/contracts/ERC20.sol
Line 238 in 652e0e9
The mint method can be only invoked by quorum of bridge oracles.
Bridge oracles work according to the rule - if N TONCOINS are minted in the Ethereum/BSC network, then N native Toncoins must be locked in the TON network before.
Due to the reason described in the previous paragraph, overflow cannot happen in real life.
Despite the fact that there are no critical exploitation, in the next versions of the contract it would be good for us to use the solidity version 8+ or use the SafeMath library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.