
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Write smart contracts in Ruby, generate production-ready Solidity code
SolidRail is a powerful transpiler that allows Ruby developers to write smart contracts using familiar Ruby syntax while generating equivalent Solidity code for deployment on Ethereum and other EVM-compatible blockchains.
gem install solidrail
Or add to your Gemfile:
gem 'solidrail'
# token.rb
class Token < ERC20
def initialize(name, symbol)
@name = name
@symbol = symbol
@total_supply = 1_000_000
@balances = {}
end
def transfer(to, amount)
require(balance_of(msg.sender) >= amount, "Insufficient balance")
@balances[msg.sender] -= amount
@balances[to] += amount
emit Transfer(msg.sender, to, amount)
end
def balance_of(owner)
@balances[owner] || 0
end
end
solidrail compile token.rb
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20 {
string public name;
string public symbol;
uint256 public totalSupply;
mapping(address => uint256) public balances;
constructor(string memory _name, string memory _symbol) {
name = _name;
symbol = _symbol;
totalSupply = 1000000;
}
function transfer(address to, uint256 amount) public {
require(balanceOf(msg.sender) >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
balances[to] += amount;
emit Transfer(msg.sender, to, amount);
}
function balanceOf(address owner) public view returns (uint256) {
return balances[owner] != 0 ? balances[owner] : 0;
}
}
Ripper
class MyToken < ERC20
def initialize(name, symbol)
@name = name
@symbol = symbol
end
end
Becomes:
contract MyToken is ERC20 {
string public name;
string public symbol;
constructor(string memory _name, string memory _symbol) {
name = _name;
symbol = _symbol;
}
}
def transfer(to, amount)
require(balance_of(msg.sender) >= amount, "Insufficient balance")
@balances[msg.sender] -= amount
@balances[to] += amount
emit Transfer(msg.sender, to, amount)
end
Becomes:
function transfer(address to, uint256 amount) public {
require(balanceOf(msg.sender) >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
balances[to] += amount;
emit Transfer(msg.sender, to, amount);
}
# Clone the repository
git clone https://github.com/solidrail/solidrail.git
cd solidrail
# Install dependencies
bundle install
# Run tests
bundle exec rspec
# Run linter
bundle exec rubocop
# Compile a Ruby file to Solidity
solidrail compile contract.rb
# Validate a Ruby file for smart contract patterns
solidrail validate contract.rb
# Parse a Ruby file and show AST
solidrail parse contract.rb
# Show version information
solidrail version
# Run all tests
bundle exec rspec
# Run with coverage
COVERAGE=true bundle exec rspec
# Run specific test file
bundle exec rspec spec/parser_spec.rb
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-feature
)bundle exec rspec
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)Component | Status | Coverage |
---|---|---|
Ruby Parser | โ Complete | 95% |
Type Mapper | ๐ In Progress | 60% |
Code Generator | ๐ In Progress | 45% |
Optimizer | ๐ In Progress | 30% |
Validator | โ Complete | 85% |
CLI Interface | โ Complete | 90% |
SolidRail includes several security features:
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Unknown package
We found that solidrail demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socketโs AI scanner detected the supply chain attack and flagged the malware.