Skip to content

Instantly share code, notes, and snippets.

function buy(address _reserveToken, uint256 _depositAmount, uint256 _minimumValue) public returns (uint256 value) {
uint8 reserveRatio = reserveRatioOf[_reserveToken];
if (reserveRatio == 0 || _depositAmount == 0) // validate input
throw;
if (stage != Stage.Traded) // validate state
throw;
ReserveToken reserveToken = ReserveToken(_reserveToken);
uint256 reserveBalance = reserveToken.balanceOf(this);
function BancorToken(string _name, string _symbol, uint8 _numDecimalUnits, address _formula, address _events) {
if (bytes(_name).length == 0 || bytes(_symbol).length < 1 || bytes(_symbol).length > 6 || _formula == 0x0) // validate input
throw;
name = _name;
symbol = _symbol;
numDecimalUnits = _numDecimalUnits;
formula = _formula;
events = _events;
@noaaizental
noaaizental / single.php
Last active January 28, 2016 10:32
Atlanta Theme - Single post with Thumbnail
<?php
/**
* Default Single
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( $image_url = Pojo_Thumbnails::get_post_thumbnail_url( array( 'width' => '940', 'height' => '300' ) ) ) : ?>
<img src="<?php echo $image_url; ?>" alt="<?php echo esc_attr( get_the_title() ); ?>" class="media-object" />