amagicneko / espp Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
crash on
inline void number(StackTop stack, ExecutionState& state) noexcept
{
auto n = state.get_tx_context(); // crashed here
stack.push(static_cast<uint64_t>(n.block_number));
}
it is odd.
backtrack
const evmc_tx_context& get_tx_context() noexcept
{
if (INTX_UNLIKELY(m_tx.block_timestamp == 0))
m_tx = host.get_tx_context();
return m_tx;
}
evmc_tx_context SimulateHost::get_tx_context() const noexcept {
return _context;
}
for (auto& log: logs) {
if (log.address != factory_address) {
LOG(INFO) << "not matched factory address::" << log.address.to_string();
continue;
}
LOG(INFO) << "matched log:" << log.to_string();
if (log.data.size() != 64) [[unlikely]] {
LOG(INFO) << "wrong log data:" << log.data.to_string();
continue;
}
if (log.topics.size() != 4) [[unlikely]] {
LOG(INFO) << "wrong log topics:" << log.topics[0].to_string();
continue;
}
/*
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
*/
Address token1(log.topics[1]);
Address token2(log.topics[2]);
uint64_t fee = log.topics[3].to_uint256().convert_to<uint64_t>();
uint64_t tick_space = log.data.to_uint256(0, 32).convert_to<uint64_t>();;
Address pool(log.data, 44, 64); // pool has the same address as the PoolManager::instance()->_pools[1]->address
PoolManager::instance()->add_uniswapv3_pool(pool, token1, token2, fee, tick_space);
UniswapV3Pool* p = 0;
...
UniswapV3Pool* PoolManager::add_uniswapv3_pool(const Address& pool_addr, const Address& token0, const Address& token1, uint64_t fee, uint64_t tickspace) {
if (_pools_address_map.seek(pool_addr) != 0) {
return 0;
}
add_token(token0);
add_token(token0);
uint32_t index0 = _tokens_index[token0];
uint32_t index1 = _tokens_index[token0];
auto p = new UniswapV3Pool(index0, index1, pool_addr, fee, tickspace, 2 * FLAGS_uniswapv3_half_tick_count + 1);
_pools.push_back(p); // pushed here
_pools_map[index0][index1].push_back(_pools.size() - 1);
_pools_reverse_map[index1][index0].push_back(_pools.size()-1);
assert(_pools_address_map.seek(pool_addr) == 0);
_pools_address_map.insert(pool_addr, _pools.size()-1);
LOG(INFO) << "added uniswapV3 pool:" << p->address.to_string();
for (auto pp : _pools) {
LOG(INFO) << pp->address.to_string();
}
return 0;
}
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.